/* ===== Admin Page Modern Design ===== */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
}

/* Container */
.admin-container {
    max-width: 1200px;
    margin: 100px auto 40px;
    padding: 0 24px;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #1a1a2e;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #1a1a2e 0%, #3d3d5c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: #6b7280;
    margin-bottom: 32px;
    font-size: 1rem;
    font-weight: 500;
}

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

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 2px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #c9a84c;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .num {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1a1a2e 0%, #c9a84c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.stat-card .label {
    font-size: 0.88rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Users Table */
.users-table {
    background: #ffffff;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 2px solid #e5e7eb;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    color: #c9a84c;
    padding: 18px 20px;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid #c9a84c;
}

.users-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.94rem;
    vertical-align: middle;
}

.users-table tr:last-child td { border-bottom: none; }

.users-table tbody tr {
    transition: all 0.2s ease;
}

.users-table tbody tr:hover {
    background: linear-gradient(135deg, #fffbf0 0%, #fef8e7 100%);
    transform: scale(1.01);
    box-shadow: inset 4px 0 0 #c9a84c;
}

.user-email {
    color: #9ca3af;
    font-size: 0.86rem;
    font-family: 'Courier New', monospace;
}

/* Provider Badges */
.provider-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provider-google {
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    color: #1a73e8;
    border: 1px solid #a8c7fa;
}

.provider-email {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.verified-yes {
    color: #059669;
    font-weight: 700;
}

.verified-no {
    color: #dc2626;
    font-weight: 700;
}

/* Role Badges */
.roles-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.role-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.role-badge .remove-role {
    background: rgba(0,0,0,0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 50%;
    margin-left: 2px;
    transition: all 0.2s;
}

.role-badge .remove-role:hover {
    background: rgba(0,0,0,0.3);
    transform: rotate(90deg);
}

/* Add Role Dropdown */
.add-role-wrapper {
    position: relative;
    display: inline-block;
}

.add-role-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px dashed #d1d5db;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    cursor: pointer;
    font-size: 16px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 700;
}

.add-role-btn:hover {
    border-color: #c9a84c;
    border-style: solid;
    color: #c9a84c;
    background: #fffbf0;
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

.role-dropdown {
    display: none;
    position: absolute;
    top: 35px;
    left: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    animation: dropdownSlide 0.2s ease-out;
}

.role-dropdown.open-upward {
    top: auto;
    bottom: 35px;
    animation: dropdownSlideUp 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.role-dropdown.open { display: block; }

.role-dropdown button {
    display: block;
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    color: #374151;
}

.role-dropdown button:hover {
    background: linear-gradient(135deg, #fffbf0 0%, #fef8e7 100%);
    color: #1a1a2e;
    padding-left: 22px;
}

.role-dropdown button.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    text-decoration: line-through;
}

.role-dropdown button.disabled:hover {
    background: none;
    padding-left: 18px;
}

/* Delete Button */
.delete-btn {
    padding: 7px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #f3f4f6;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.delete-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        margin-top: 80px;
        padding: 0 16px;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .stat-card .num {
        font-size: 2rem;
    }

    .users-table {
        overflow-x: auto;
        border-radius: 12px;
    }

    .users-table table {
        min-width: 800px;
    }

    .users-table th,
    .users-table td {
        padding: 14px 16px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
