/* 
 * Admin Portal CSS
 * Shared glass-morphism styles for admin interface
 * Modern design system with consistent styling
 */

/* === CSS VARIABLES === */
:root {
    --admin-primary-gradient: linear-gradient(135deg, #6699ea 0%, #4b65a2 100%);
    --glass-background: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(20px);
    --glass-light: rgba(255, 255, 255, 0.1);
    --glass-medium: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-shadow-large: 0 12px 40px rgba(0, 0, 0, 0.15);
    /* Dark glass variants */
    --glass-dark-background: rgba(0, 0, 0, 0.4);
    --glass-dark-border: rgba(255, 255, 255, 0.2);
    --glass-dark-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-dark-shadow-large: 0 15px 45px rgba(0, 0, 0, 0.4);
    --border-radius-sm: 12px;
    --border-radius-md: 16px;
    --border-radius-lg: 20px;
    --transition-smooth: all 0.3s ease;
    --transition-fast: all 0.2s ease;
}

/* === NAVIGATION BAR === */
.navbar-dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    border-bottom: 3px solid var(--primary-color, #dc2626);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar-dark .navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-dark .navbar-brand:hover {
    color: var(--primary-color, #dc2626) !important;
}

.navbar-dark .nav-link {
    color: #e9ecef !important;
    font-weight: 500;
    padding: 0.7rem 1rem !important;
    border-radius: 6px;
    margin: 0 2px;
    transition: var(--transition-smooth);
}

.navbar-dark .nav-link:hover {
    color: #ffffff !important;
    background: rgba(var(--primary-color), 0.1);
    transform: translateY(-1px);
}

.navbar-dark .nav-link.active {
    color: var(--primary-color, #dc2626) !important;
    background: rgba(var(--primary-color), 0.15);
}

.navbar-dark .dropdown-menu {
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    margin-top: 5px;
}

.navbar-dark .dropdown-item {
    color: #e9ecef;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    margin: 2px 6px;
    transition: var(--transition-fast);
}

.navbar-dark .dropdown-item:hover {
    background: var(--primary-color, #dc2626);
    color: #ffffff;
    transform: translateX(3px);
}

.navbar-dark .dropdown-item i {
    margin-right: 8px;
    width: 16px;
}

.navbar-dark .dropdown-divider {
    border-color: #404040;
    margin: 8px 0;
}

.navbar-dark .navbar-toggler {
    border: 1px solid #555;
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-section-title {
    color: var(--primary-color, #dc2626) !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.2rem 0.2rem !important;
    border-bottom: 1px solid #404040;
    margin-bottom: 4px;
    cursor: default !important;
    pointer-events: none !important;
}

.nav-section-title:hover {
    background: none !important;
    color: var(--primary-color, #dc2626) !important;
    transform: none !important;
}

/* === GROWTH INDICATORS === */
.growth-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.growth-positive { 
    color: #4CAF50; 
}

.growth-negative { 
    color: #f44336; 
}

.growth-neutral { 
    color: #9E9E9E; 
}

.conversation-preview-item {
    background: var(--glass-light);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.conversation-preview-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.conversation-preview-item:last-child {
    border-bottom: none;
}

/* === BASE LAYOUT === */
.admin-page {
    background: var(--admin-primary-gradient);
    min-height: 100vh;
    padding: 0;
}

.page-header {
    background: var(--glass-light);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

/* === GLASS MORPHISM CARDS === */
.glass-card {
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow-large);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.glass-card-sm {
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
}

.glass-card-dark {
    background: var(--glass-dark-background);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-dark-border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-dark-shadow-large);
    transition: var(--transition-smooth);
}

.glass-card-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.glass-section {
    background: var(--glass-medium);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* === STATISTICS CARDS === */
.stat-card {
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
    box-shadow: var(--glass-shadow);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow-large);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.1;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

/* === METRIC GROUPING STYLES === */
.metric-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    transition: var(--transition-fast);
}

.metric-item:hover {
    transform: translateY(-2px);
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === MEMBER AVATARS === */
.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--admin-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 12px;
}

.member-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--admin-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.member-avatar-xl {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--admin-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 700;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 1.5rem;
}

/* === FORM ELEMENTS === */
.form-section {
    background: var(--glass-medium);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 0.75rem;
    color: #667eea;
}

.form-control {
    border-radius: var(--border-radius-sm);
    border: 2px solid #e9ecef;
    padding: 0.375rem 0.75rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select {
    border-radius: var(--border-radius-sm);
    border: 2px solid #e9ecef;
    padding: 0.375rem 0.75rem;
}

/* === INPUT GROUPS === */
.input-group {
    display: flex !important;
    align-items: center !important;
}

.input-group .form-control {
    padding: 0.375rem 0.75rem !important;
    height: 38px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm) !important;
}

.input-group .btn {
    padding: 0.375rem 1rem !important;
    height: 38px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.input-group .btn:last-child {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0 !important;
}

/* === BUTTONS === */
.btn-glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #495057;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* === BUTTON GROUP STYLING === */
.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
    border-right: none;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.btn-group .btn i {
    margin-right: 0.25rem;
}

.btn-glass:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.85) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
    color: #212529;
    text-decoration: none;
}

.btn-glass:active {
    transform: translateY(0);
}

.btn-glass:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
}

.btn-primary-glass {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-success-glass {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    text-decoration: none;
}

.btn-success:active {
    transform: translateY(0);
}

.btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d80 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    text-decoration: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
    text-decoration: none;
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}

/* === BUTTON SPACING === */
button[type="submit"],
.btn {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.btn + .btn {
    margin-left: 0.5rem;
}

.text-center .btn,
.d-flex .btn {
    margin-top: 0;
}

/* === ADMIN FOOTER === */
.admin-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-top: 3px solid var(--primary-color, #dc2626);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    margin-top: 0;
    padding-top: 30px;
    color: #e9ecef;
    position: relative;
}

/* Ensure no gap by extending admin page background */
body {
    background: var(--admin-primary-gradient);
}

.admin-page {
    padding-bottom: 0;
}

.footer-brand {
    font-weight: 600;
    font-size: 1.1rem;
}

.gym-name {
    color: #ffffff;
}

.powered-by {
    font-size: 0.9rem;
    color: #adb5bd;
}

.membiax-link {
    color: #6c9eff;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.membiax-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .admin-footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 1rem;
    }
    
    .admin-footer .col-md-6:last-child {
        margin-bottom: 0;
    }
}

.btn-secondary-glass {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.btn-secondary-glass:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid rgba(108, 117, 125, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 0.375rem 1rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.btn-outline-secondary:hover {
    background: rgba(108, 117, 125, 0.1);
    border-color: #6c757d;
    color: #495057;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
    text-decoration: none;
}

.btn-outline-secondary:active {
    background: rgba(108, 117, 125, 0.2);
    transform: translateY(0);
}

/* === STATUS BADGES === */
.status-badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge-xl {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* === TABLES === */
.table-glass {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.action-btn {
    padding: 0.5rem;
    border-radius: 8px;
    border: none;
    transition: var(--transition-fast);
    margin: 0 2px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* === ALERTS & BANNERS === */
.alert-banner {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.overdue-banner {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* === PROGRESS STEPS === */
.progress-steps {
    background: var(--glass-light);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: white;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
}

.step.active .step-number {
    background: #28a745;
}

.step.completed .step-number {
    background: #17a2b8;
}

/* === FAMILY MEMBERS === */
.family-member-item {
    background: var(--glass-medium);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

.family-member-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.family-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 1rem;
}

/* === INFO GRIDS === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.info-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #495057;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.info-section-title i {
    margin-right: 0.75rem;
    color: #667eea;
}

/* === COLOR INPUT GROUPS === */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input-group .form-control-color {
    width: 60px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: var(--transition-fast);
}

.color-input-group .form-control-color:hover {
    border-color: var(--primary-color, #dc2626);
    transform: scale(1.05);
}

.color-preview {
    width: 40px;
    height: 40px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    transition: var(--transition-fast);
}

.color-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 2px;
    background: var(--preview-color, #ffffff);
}

/* === UTILITIES === */
.text-glass {
    color: rgba(255, 255, 255, 0.9);
}

.bg-glass {
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
}

.border-glass {
    border: 1px solid var(--glass-border);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .glass-card,
    .glass-card-sm {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .member-avatar-xl {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}