/* ============================================
   SIMPLIFIED STYLES FOR PROFILE, SETTINGS, BILLING
   HIGH SPECIFICITY TO OVERRIDE CONFLICTING STYLES
   ============================================ */

/* CRITICAL FIX: Override conflicting main element styles */
body.profile-page-body main,
body.settings-page-body main,
body.billing-page-body main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
}

/* OVERRIDE OLD GRADIENT STYLES with higher specificity */
html body.profile-page-body,
html body.settings-page-body,
html body.billing-page-body {
    /* Navy to blue gradient - OVERRIDE OLD STYLES */
    background: linear-gradient(135deg, #6772e5 0%, #1a1f36 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    overflow-x: hidden !important;
}

/* CRITICAL: Fixed positioning for pages accounting for navbar */
html body.profile-page-body .profile-page,
html body.settings-page-body .settings-page,
html body.billing-page-body .billing-page {
    /* Fixed positioning to prevent shift */
    position: relative !important;
    top: 0 !important;
    padding-top: 40px !important; /* Match navbar height exactly */
    padding-bottom: 2rem !important;
    min-height: calc(100vh - 80px) !important;
    margin: 0 !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Page Container with high specificity */
html body .profile-page .page-container,
html body .settings-page .page-container,
html body .billing-page .page-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 2rem 1.5rem !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Page Header - Fixed positioning */
html body .profile-page .page-header,
html body .settings-page .page-header,
html body .billing-page .page-header {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
    padding-bottom: 1rem !important;
    padding-top: 0 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: transparent !important;
    position: relative !important;
}

/* Force white text for titles with maximum specificity */
html body.profile-page-body .profile-page .page-header h1,
html body.settings-page-body .settings-page .page-header h1,
html body.billing-page-body .billing-page .page-header h1 {
    font-size: 2.5rem !important;
    color: #ffffff !important;
    margin: 0 !important;
    font-weight: 600 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2) !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Content area backgrounds with high specificity */
html body .profile-page .profile-content,
html body .settings-page .settings-content,
html body .billing-page .billing-content {
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Card Styles with high specificity */
html body .profile-page .profile-card,
html body .settings-page .settings-card,
html body .billing-page .billing-card {
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    margin-bottom: 1.5rem !important;
    overflow: hidden !important;
}

/* Card Headers */
html body .profile-card .card-header,
html body .settings-card .card-header,
html body .billing-card .card-header {
    background: linear-gradient(135deg, #6772e5 0%, #5469d4 100%) !important;
    color: white !important;
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

html body .profile-card .card-header h2,
html body .settings-card .card-header h2,
html body .billing-card .card-header h2 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    color: white !important;
}

/* Card Body */
.profile-card .card-body,
.settings-card .card-body,
.billing-card .card-body {
    padding: 1.5rem;
}

/* Form Styles - Settings Page */
.settings-page .form-group {
    margin-bottom: 1.5rem;
}

.settings-page .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a4a4a;
}

.settings-page .form-group input,
.settings-page .form-group select,
.settings-page .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.settings-page .form-group input:focus,
.settings-page .form-group select:focus,
.settings-page .form-group textarea:focus {
    outline: none;
    border-color: #6772e5;
    box-shadow: 0 0 0 3px rgba(103, 114, 229, 0.15);
}

/* Button Styles */
.profile-page .btn,
.settings-page .btn,
.billing-page .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.profile-page .btn-primary,
.settings-page .btn-primary,
.billing-page .btn-primary {
    background: linear-gradient(135deg, #6772e5 0%, #5469d4 100%) !important;
    color: white !important;
}

.profile-page .btn-primary:hover,
.settings-page .btn-primary:hover,
.billing-page .btn-primary:hover {
    background: linear-gradient(135deg, #5469d4 0%, #4350c7 100%) !important;
    box-shadow: 0 4px 8px rgba(103, 114, 229, 0.3);
}

.profile-page .btn-secondary,
.settings-page .btn-secondary,
.billing-page .btn-secondary {
    background: #f5f5f5;
    color: #333 !important;
    border: 1px solid #ddd;
}

.profile-page .btn-secondary:hover,
.settings-page .btn-secondary:hover,
.billing-page .btn-secondary:hover {
    background: #e8e8e8;
}

.settings-page .btn-danger {
    background: #ff4444;
    color: white !important;
}

.settings-page .btn-danger:hover {
    background: #cc0000;
}

/* Info Groups - Profile */
.profile-page .info-group {
    margin-bottom: 1rem;
}

.profile-page .info-group label {
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 0.25rem;
    display: block;
}

.profile-page .info-group p {
    margin: 0;
    font-size: 1rem;
    color: #2d2d2d;
}

/* Stats Grid - Profile */
.profile-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    text-align: center;
}

.profile-page .stat-item {
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 4px;
}

.profile-page .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #6772e5;
}

.profile-page .stat-label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Checkbox Styles - Settings */
.settings-page .checkbox-group {
    margin-bottom: 1rem;
}

.settings-page .checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.settings-page .checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: auto;
}

.settings-page .checkbox-label span {
    color: #4a4a4a;
}

/* Danger Zone - Settings */
.settings-page .danger-zone {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ff4444;
}

.settings-page .danger-zone h3 {
    color: #ff4444;
    margin-bottom: 1rem;
}

/* Plans Grid - Billing */
.billing-page .plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.billing-page .plan-option {
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.billing-page .plan-option:hover {
    border-color: #6772e5;
    box-shadow: 0 4px 12px rgba(103, 114, 229, 0.2);
}

.billing-page .plan-option h3 {
    margin: 0 0 0.5rem 0;
    color: #2d2d2d;
}

.billing-page .plan-price {
    font-size: 2rem;
    font-weight: bold;
    color: #6772e5;
    margin: 0.5rem 0;
}

.billing-page .plan-price span {
    font-size: 1rem;
    color: #888;
}

.billing-page .savings-badge {
    background: #FFD93D;
    color: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: bold;
    display: inline-block;
    margin: 0.5rem 0;
}

.billing-page .plan-features {
    margin-top: 1rem;
}

.billing-page .plan-features h4 {
    margin: 0 0 0.5rem 0;
    color: #4a4a4a;
    font-size: 1rem;
}

.billing-page .plan-features ul,
.billing-page .plan-features-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.billing-page .plan-features li,
.billing-page .plan-features-list li {
    padding: 0.5rem 0;
    color: #666;
    position: relative;
    padding-left: 1.5rem;
}

.billing-page .plan-features li:before,
.billing-page .plan-features-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #6772e5;
    font-weight: bold;
}

/* Empty State */
.profile-page .empty-state,
.settings-page .empty-state,
.billing-page .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.profile-page .empty-state p,
.settings-page .empty-state p,
.billing-page .empty-state p {
    margin: 0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    html body.profile-page-body .profile-page,
    html body.settings-page-body .settings-page,
    html body.billing-page-body .billing-page {
        padding-top: 70px !important;
    }
    
    html body .profile-page .page-container,
    html body .settings-page .page-container,
    html body .billing-page .page-container {
        padding: 1rem !important;
    }
    
    html body .profile-page .page-header h1,
    html body .settings-page .page-header h1,
    html body .billing-page .page-header h1 {
        font-size: 1.75rem !important;
    }
    
    .billing-page .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-page .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .profile-card .card-body,
    .settings-card .card-body,
    .billing-card .card-body {
        padding: 1rem;
    }
}