/* FC Hermagor Player Portal - Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0066CC;
    min-height: 100vh;
    padding: 20px;
}

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container img {
    max-width: 200px;
    height: auto;
}

/* Main Container */
.container {
    max-width: 95%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 30px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.nav-title {
    color: #0066CC;
    margin: 0;
    font-size: 24px;
    white-space: nowrap;
}

.nav-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: contain;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: #f8f9fa;
    white-space: nowrap;
}

.nav-item:hover {
    background: #e9ecef;
    color: #0066CC;
    transform: translateY(-1px);
}

.nav-item.active {
    background: #0066CC;
    color: white;
    border-color: #0066CC;
}

.nav-item.active:hover {
    background: #0055AA;
    border-color: #0055AA;
    color: white;
}

.nav-item-secondary {
    background: white;
    border: 2px solid #dee2e6;
}

.nav-item-secondary:hover {
    background: #f8f9fa;
    border-color: #0066CC;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.user-label {
    color: #6c757d;
}

.user-name {
    color: #0066CC;
    font-weight: 600;
}

.btn-icon {
    padding: 10px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #0066CC;
    color: #0066CC;
    transform: translateY(-1px);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Player Icons Container */
.player-icons {
    display: inline-flex;
    gap: 2px;
    margin-left: 2px;
    vertical-align: super;
    align-items: center;
}

.player-icons img {
    margin-left: 0;
    vertical-align: baseline;
}

/* Headings */
h1, h2, h3 {
    color: #0066CC;
    margin-bottom: 20px;
}

h4 {
    color: #0066CC;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Section Management */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.form-section h4 {
    color: #0066CC;
    margin-bottom: 15px;
    font-size: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0066CC;
}

input:disabled, select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Buttons */
button {
    background: #0066CC;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

button:hover {
    background: #0055AA;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

button.secondary {
    background: #6c757d;
    margin-left: 10px;
}

button.secondary:hover {
    background: #5a6268;
}

button.danger {
    background: #dc3545;
    padding: 8px 16px;
    font-size: 14px;
}

button.danger:hover {
    background: #c82333;
}

button.edit {
    background: #FFD700;
    color: #000;
    padding: 8px 16px;
    font-size: 14px;
    margin-right: 8px;
}

button.edit:hover {
    background: #FFC700;
}

/* Icon Buttons */
button.btn-icon-edit,
button.btn-icon-delete {
    padding: 6px 8px;
    font-size: 14px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

button.btn-icon-edit {
    background: #FFD700;
    color: #000;
    margin-right: 6px;
}

button.btn-icon-edit:hover {
    background: #FFC700;
    transform: scale(1.1);
}

button.btn-icon-delete {
    background: #dc3545;
    color: white;
}

button.btn-icon-delete:hover {
    background: #c82333;
    transform: scale(1.1);
}

button.btn-icon-view {
    background: #0066CC;
    color: white;
    margin-right: 6px;
}

button.btn-icon-view:hover {
    background: #0055aa;
    transform: scale(1.1);
}

button.btn-icon-edit svg,
button.btn-icon-delete svg,
button.btn-icon-view svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Print: only show playerViewPrintArea */
@media print {
    body > *:not(#playerViewModal),
    #playerViewModal .modal-footer,
    .modal-header button {
        display: none !important;
    }
    #playerViewModal {
        display: block !important;
        position: static !important;
        background: none !important;
    }
    #playerViewModal .modal-content {
        box-shadow: none !important;
        max-width: 100% !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    #playerViewPrintArea {
        display: block !important;
    }
    .no-print {
        display: none !important;
    }
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* User Info Header */
.user-info-header {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #0066CC;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info-header .nav-links {
    display: flex;
    gap: 16px;
}

.user-info-header a {
    color: #0066CC;
    text-decoration: none;
    font-weight: 600;
}

.user-info-header a:hover {
    text-decoration: underline;
}

.user-info-header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info-header .user-name {
    color: #666;
    font-size: 14px;
}

.user-info-header .user-name strong {
    color: #0066CC;
    margin-left: 8px;
    font-size: 16px;
}

.user-info-header button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    color: #0066CC;
}

/* Player Info */
.player-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.player-info h2 {
    color: #0066CC;
    margin-bottom: 15px;
}

.info-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #333;
}

/* Contacts Section */
.contacts-section {
    margin-top: 30px;
    margin-bottom: 40px;
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contacts-header h3 {
    color: #0066CC;
}

.add-contact-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.contact-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #e9ecef;
}

.contact-card h4 {
    color: #333;
    margin-bottom: 8px;
}

.contact-detail {
    font-size: 14px;
    color: #666;
    margin: 4px 0;
}

.contact-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #0066CC;
    margin-bottom: 0;
}

.close-btn {
    background: none;
    color: #999;
    font-size: 24px;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    color: #666;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #0066CC;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background-color: #e9ecef;
}

tr:hover {
    background-color: #f1f1f1;
}

td button {
    margin-right: 8px;
}

/* Status Badges */
.status-active {
    color: green;
    font-weight: bold;
}

.status-inactive {
    color: #999;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #0066CC;
}

/* Search and Filter */
.search-container {
    margin-bottom: 20px;
}

.search-container input {
    max-width: 400px;
}

/* Compact backend UI (admin pages) */
body.admin-compact {
    padding: 16px;
}

body.admin-compact .container {
    padding: 28px;
}

body.admin-compact .nav-title {
    font-size: 22px;
}

body.admin-compact .nav-item {
    padding: 8px 12px;
    font-size: 13px;
}

body.admin-compact .user-info {
    padding: 6px 12px;
    font-size: 13px;
}

body.admin-compact button {
    padding: 10px 16px;
    font-size: 14px;
}

body.admin-compact button.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

body.admin-compact input,
body.admin-compact select,
body.admin-compact textarea {
    padding: 10px;
    font-size: 13px;
}

body.admin-compact input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    border-radius: 4px;
}

body.admin-compact .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    height: 40px;
}

body.admin-compact .checkbox-icon {
    height: 30px;
    width: auto;
    object-fit: contain;
}

body.admin-compact #searchInput {
    max-width: 520px;
}

body.admin-compact .tabs {
    gap: 6px;
}

body.admin-compact .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

body.admin-compact table {
    margin-top: 12px;
    font-size: 13px;
}

body.admin-compact th,
body.admin-compact td {
    padding: 8px 10px;
}

body.admin-compact td button {
    padding: 6px 10px;
    font-size: 12px;
}

body.admin-compact .team-filter-group {
    gap: 6px;
}

body.admin-compact .team-filter-group select {
    height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
}

body.admin-compact .team-filter-group .btn-icon {
    height: 40px;
    width: 48px;
    padding: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h3 {
    color: #999;
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
}

/* Warning Box */
.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.warning-box strong {
    color: #856404;
    display: block;
    margin-bottom: 8px;
}

.warning-box p {
    color: #856404;
    margin: 0;
}

/* Action Buttons in Cards */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .user-info-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }
}

/* Player History Timeline */
.history-timeline {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.history-day {
    margin-bottom: 25px;
}

.history-day-header {
    font-weight: bold;
    color: #0066CC;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #0066CC;
}

.history-entry {
    position: relative;
    padding: 12px 12px 12px 30px;
    margin-bottom: 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #dee2e6;
    transition: all 0.2s;
}

.history-entry:hover {
    border-left-color: #0066CC;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.history-entry::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dee2e6;
    border: 2px solid white;
}

.history-entry:hover::before {
    background: #0066CC;
}

.history-time {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 4px;
}

.history-user {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.history-change {
    font-size: 13px;
    color: #212529;
    margin-top: 6px;
}

.history-field {
    font-weight: 500;
    color: #0066CC;
}

.history-value-old {
    color: #dc3545;
    text-decoration: line-through;
}

.history-value-new {
    color: #28a745;
    font-weight: 500;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}
