/* ============================================================
   ELITE FITNESS – ADMIN PANEL STYLES
   Complete with Golden Ratio, Modals, Responsive
   ============================================================ */

/* ============================================================
   ROOT VARIABLES (Golden Ratio + Theme)
   ============================================================ */
:root {
    --gr-xs: 8px;
    --gr-sm: 13px;
    --gr-md: 21px;
    --gr-lg: 34px;
    --gr-xl: 55px;
    --gr-xxl: 89px;
    --gr-ratio: 1.618;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-body);
    padding: var(--gr-md);
    width: 100%;
}

.login-box {
    background: var(--bg-card);
    padding: var(--gr-xl) var(--gr-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.login-box:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.login-box .login-icon {
    text-align: center;
    font-size: 48px;
    color: var(--accent);
    margin-bottom: var(--gr-md);
    display: block;
}

.login-box h2 {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--gr-xs);
    color: var(--text-primary);
}

.login-box .login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: var(--gr-lg);
}

.login-box .form-group {
    margin-bottom: var(--gr-md);
}

.login-box .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--gr-xs);
}

.login-box .form-group input {
    width: 100%;
    padding: var(--gr-sm) var(--gr-md);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 15px;
    min-height: 48px;
    font-family: var(--font);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-box .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.login-box .form-group input::placeholder {
    color: var(--text-muted);
}

.login-box .btn-primary {
    width: 100%;
    justify-content: center;
    padding: var(--gr-sm);
    font-size: 16px;
    margin-top: var(--gr-sm);
    min-height: 48px;
}

.login-box .login-error {
    color: #ff4757;
    font-size: 13px;
    text-align: center;
    margin-bottom: var(--gr-sm);
    min-height: 24px;
}

.login-box .login-footer {
    text-align: center;
    margin-top: var(--gr-md);
    font-size: 13px;
    color: var(--text-muted);
}

.login-box .login-footer a {
    color: var(--accent);
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-box .login-footer a:hover {
    color: var(--accent-hover);
}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */
.admin-dashboard {
    padding-top: 100px;
    padding-bottom: var(--gr-xxl);
    background: var(--bg-body);
    min-height: 100vh;
}

.admin-dashboard h1 {
    font-size: 34px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: var(--gr-xs);
}

.admin-dashboard .subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: var(--gr-xl);
    line-height: 1.6;
}

/* Stats */
.admin-dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gr-md);
    margin-bottom: var(--gr-xl);
}

.admin-dashboard .stat-card {
    background: var(--bg-card);
    padding: var(--gr-md);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all 0.3s ease;
}

.admin-dashboard .stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.admin-dashboard .stat-card .stat-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -1px;
    line-height: 1.2;
}

.admin-dashboard .stat-card .stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: var(--gr-xs);
    font-weight: 500;
}

/* Admin Cards */
.admin-card {
    background: var(--bg-card);
    padding: var(--gr-lg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: var(--gr-xl);
    transition: all 0.3s ease;
}

.admin-card:hover {
    border-color: rgba(0, 200, 83, 0.2);
}

.admin-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--gr-md);
    color: var(--text-primary);
}

.admin-card h3 i {
    margin-right: var(--gr-sm);
    color: var(--accent);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 0 -4px;
}

.admin-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-card th {
    text-align: left;
    padding: var(--gr-sm) var(--gr-md);
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--border-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-card td {
    padding: var(--gr-sm) var(--gr-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 13px;
    vertical-align: middle;
}

.admin-card tr:hover td {
    background: var(--accent-dim);
}

/* Status Badges */
.admin-card .status-badge {
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.3px;
}

.admin-card .status-badge.active {
    background: rgba(0, 200, 83, 0.15);
    color: var(--accent);
}

.admin-card .status-badge.expired {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gr-xs);
}

.admin-actions .btn-primary {
    padding: 4px 14px;
    font-size: 11px;
    min-height: 30px;
    border-radius: 6px;
}

.admin-actions .btn-outline {
    padding: 4px 14px;
    font-size: 11px;
    min-height: 30px;
    border-radius: 6px;
    border-width: 1.5px;
}

/* ============================================================
   ADMIN MODALS (Edit Member + Assign Plan + Confirm)
   ============================================================ */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gr-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--gr-xl) var(--gr-lg);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    opacity: 0;
}

.admin-modal-overlay.active .admin-modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.admin-modal-box h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: var(--gr-md);
    color: var(--text-primary);
}

.admin-modal-box .form-group {
    margin-bottom: var(--gr-md);
}

.admin-modal-box .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--gr-xs);
}

.admin-modal-box .form-group input,
.admin-modal-box .form-group select {
    width: 100%;
    padding: var(--gr-sm) var(--gr-md);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font);
    min-height: 44px;
}

.admin-modal-box .form-group input:focus,
.admin-modal-box .form-group select:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}

.admin-modal-box .form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23AAAAAA' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.admin-modal-box .form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.admin-modal-box .form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

.admin-modal-box .modal-actions {
    display: flex;
    gap: var(--gr-sm);
    margin-top: var(--gr-md);
}

.admin-modal-box .modal-actions button {
    flex: 1;
    justify-content: center;
    min-height: 44px;
}

.admin-modal-close {
    position: absolute;
    top: var(--gr-md);
    right: var(--gr-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.admin-modal-close:hover {
    color: var(--text-primary);
}

/* Confirm Modal specific */
#confirmModal .admin-modal-box {
    max-width: 420px;
}
#confirmMessage {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: var(--gr-lg);
}

/* ============================================================
   ADMIN HAMBURGER (mobile)
   ============================================================ */
.admin-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 8px;
    min-height: 48px;
    min-width: 48px;
    justify-content: center;
    z-index: 1001;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.admin-hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.admin-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.admin-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.admin-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .admin-dashboard .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--gr-sm);
    }
    .admin-card {
        padding: var(--gr-md);
    }
}

@media (max-width: 768px) {
    .admin-dashboard {
        padding-top: 80px;
    }
    .admin-dashboard .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--gr-sm);
    }
    .admin-dashboard .stat-card .stat-number {
        font-size: 26px;
    }
    .admin-dashboard h1 {
        font-size: 28px;
    }
    .admin-card {
        padding: var(--gr-sm);
    }
    .admin-card table {
        font-size: 12px;
    }
    .admin-card th,
    .admin-card td {
        padding: var(--gr-xs) var(--gr-sm);
    }
    .admin-actions {
        flex-direction: column;
        gap: var(--gr-xs);
    }
    .admin-actions .btn-primary,
    .admin-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }
    .login-box {
        padding: var(--gr-lg) var(--gr-md);
    }
    .login-box h2 {
        font-size: 24px;
    }
    .login-box .login-icon {
        font-size: 36px;
    }
    .admin-modal-box {
        padding: var(--gr-lg) var(--gr-md);
    }
    .admin-modal-box h2 {
        font-size: 22px;
    }
    .admin-modal-box .modal-actions {
        flex-direction: column;
    }
    .admin-modal-box .modal-actions button {
        width: 100%;
    }

    /* Admin Hamburger */
    .admin-hamburger {
        display: flex;
    }

    #adminNavLinks {
        display: none;
        flex-direction: column;
        background: var(--bg-nav);
        backdrop-filter: blur(16px);
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        padding: var(--gr-md) var(--gr-lg);
        gap: var(--gr-sm);
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
        z-index: 999;
        align-items: stretch;
        text-align: center;
    }

    #adminNavLinks.open {
        display: flex;
    }

    #adminNavLinks li {
        list-style: none;
    }

    #adminNavLinks a {
        display: block;
        padding: var(--gr-sm) var(--gr-md);
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        border-radius: var(--radius);
        transition: background 0.2s ease;
    }

    #adminNavLinks a:hover {
        background: var(--accent-dim);
    }

    #adminNavLinks #adminLogoutBtn {
        color: #ff4757;
    }
    #adminNavLinks #adminLogoutBtn:hover {
        background: rgba(255, 71, 87, 0.1);
    }
}

@media (max-width: 480px) {
    .admin-dashboard .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-dashboard h1 {
        font-size: 24px;
    }
    .login-box {
        padding: var(--gr-md) var(--gr-sm);
    }
    .login-box h2 {
        font-size: 20px;
    }
    .login-box .login-icon {
        font-size: 28px;
    }
    .admin-card {
        padding: var(--gr-xs);
    }
    .admin-card table {
        font-size: 11px;
    }
    .admin-card th,
    .admin-card td {
        padding: var(--gr-xs) var(--gr-sm);
    }
    .admin-modal-box {
        padding: var(--gr-md) var(--gr-sm);
    }
    .admin-modal-box h2 {
        font-size: 20px;
    }
}