/* ============================================================== */
/* SETTINGS.CSS - Professional Dark Theme with Consistent Blue/Purple Accent */
/* ============================================================== */

/* --- General Variables and Colors (Dark Theme) --- */
:root {
    /* Dark Theme Colors */
    --primary-bg: #111317; 
    --sidebar-bg: #171a21; 
    --content-bg: #1e212a; 

    /* Text Colors */
    --primary-text: #ffffff;
    --muted-text: #a0a8b9;
    
    /* Accent Colors (Based on your Gradient: #2575fc to #6a11cb) */
    --accent-blue: #2575fc; 
    --accent-purple: #6a11cb;
    --primary-accent: var(--accent-blue); /* Use blue for general indicators */
    --gradient-bg: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    
    /* Dedicated highlight color */
    --highlight-pink: #ff69b4; 

    /* UI Colors */
    --border-color: #3c4051;
    --input-bg: #2b2e3a;
    --error-color: #dc3545; 
    --heading-color: gold; 
    
    /* ADDED NEW COLOR VARIABLE */
    --teal-heading: #00B5B5; 
    --pink-error: #CC3A9E;   /* Requested pink color for cross/error */
}

/* --- Layout Structure & Sidebar --- */

.sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid var(--border-color);
}
.profile-name, .profile-role {
    color: var(--primary-text) !important;
}

/* Sidebar Navigation (Dashboard-level) */
.nav-link {
    color: var(--muted-text) !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05) !important; 
}

/* Active Dashboard Link */
.nav-link.active {
    color: var(--primary-accent) !important; 
    background-color: rgba(37, 117, 252, 0.15) !important; 
    border-right: 4px solid var(--primary-accent) !important;
    border-left: none !important;
}

/* --- Main Settings Layout --- */

.settings-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    padding: 30px 0;
}

/* --- Settings Navigation (Left Tabs) --- */

.settings-nav {
    padding: 0;
    border-radius: 8px;
    background-color: var(--content-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    height: fit-content;
}

.settings-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--muted-text);
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.settings-nav-link i {
    font-size: 1.1rem;
    margin-right: 15px;
    width: 20px;
}

/* Reduced Hover: Less intense background change */
.settings-nav-link:hover {
    color: var(--primary-text);
    background-color: rgba(255, 255, 255, 0.03); 
}

/* Active Tab Styling (Blue Accent) */
.settings-nav-link.active {
    color: var(--primary-accent); /* Blue Text */
    border-left: 4px solid var(--primary-accent); /* Blue Indicator */
    background-color: rgba(37, 117, 252, 0.15); /* Blue tint background */
}
.settings-nav-link.active i {
    color: var(--primary-accent);
}

/* --- Settings Content (Right Panel) --- */

.settings-content {
    position: relative;
    background-color: var(--content-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); 
    border-radius: 8px;
    padding: 0; 
}

.settings-panel {
    display: none; 
    padding: 30px 40px; 
    width: 100%;
}

.settings-panel.active {
    display: block;
}

/* Panel Headers (Yellow/Gold) */
.panel-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--heading-color) !important; 
    margin-bottom: 5px;
}
.panel-title i {
    color: var(--heading-color) !important;
}


.panel-sub {
    color: var(--muted-text);
    margin-bottom: 30px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

/* --- Form & Input Styles --- */

.form-group label {
    color: var(--muted-text);
}

.form-group input {
    width: 100%;
    padding: 14px; 
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    border-radius: 8px; 
}

/* Blue Focus State */
.form-group input:focus {
    border-color: var(--primary-accent); 
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.2); 
    outline: none;
}

/* --- List Items (Social/Security/Notifications) --- */

.connected-list li, 
.security-item, 
.notification-option {
    padding: 20px 0; 
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-text);
}

.platform-name {
    color: var(--primary-text);
}

.connected-item i {
    font-size: 1.8rem;
    margin-right: 20px;
    width: 30px;
}

/* --- New Platform REAL Colors --- */
.facebook-icon { color: #1877f2; }
.instagram-icon { 
    /* Instagram Gradient */
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* NEW PLATFORM COLORS */
.youtube-icon { color: #ff0000; } /* YouTube Red 🔴 */
.linkedin-icon { color: #0a66c2; } /* LinkedIn Blue 🟦 */
.pinterest-icon { color: #e60023; } /* Pinterest Red 📌 */

/* Primary Button (Applying the Gradient) */
.btn-primary {
    background: var(--gradient-bg) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


/* Disconnect Button (White/Red Outline, Blue Hover, Rounded Edges) */
.btn-danger {
    /* Base State: White background, Red outline, Black text, Rounded edges */
    background-color: #ffffff !important; /* White Background */
    border: 1px solid var(--error-color) !important; /* Red Outline */
    color: #000000 !important; /* Black Text */
    
    padding: 8px 15px !important;
    font-size: 0.9rem !important;
    border-radius: 999px !important; /* Pill-shaped (fully rounded) */
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover {
    /* Hover State: Solid Blue background, White text */
    background: var(--gradient-bg) !important; /* Use your blue/purple gradient for consistency */
    color: #ffffff !important; /* White Text */
    border-color: var(--primary-accent) !important; /* Blue Border */
    transform: translateY(-1px); /* Subtle lift on hover */
}
.btn-danger.small {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
}

/* === BILLING DETAILS PINK HIGHLIGHT === */

/* 1. Plan Name & Renewal Date */
.billing-stat .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-text) !important; /* Changed to White */
    margin-top: 5px;
}

/* New Rule: Labels (Current Plan, Next Renewal) */
.billing-stat .muted.small {
    color: var(--heading-color) !important; /* Changed to Yellow */
    /* Ensure no unwanted styles override the yellow */
    opacity: 1 !important;
}

/* 2. Download Invoice Link */
.setting-link {
    color: var(--highlight-pink) !important; /* Hot Pink Link Color */
    font-weight: 500;
    transition: color 0.2s;
}
.setting-link:hover {
    color: var(--accent-purple) !important; /* Hovering to Purple */
}
/* Ensure links inside security/other sections still use the pink highlight */
.security-item .setting-link {
    color: var(--highlight-pink) !important; 
}


/* Switch Styles (using Blue accent) */
input:checked + .slider {
    background-color: var(--primary-accent) !important; 
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    /* (Existing responsive code remains to ensure good mobile layout) */
    .settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-nav ul {
        display: flex;
        flex-wrap: nowrap; 
        overflow-x: auto;
    }
    .settings-nav-link {
        border-left: none;
        border-bottom: 4px solid transparent;
    }
    .settings-nav-link.active {
        border-left: none;
        border-bottom: 4px solid var(--primary-accent);
    }
}
/* ============================================================== */
/* MODAL POPUP STYLING (NEW & IMPROVED) */
/* ============================================================== */

/* Base Modal Styles (Keep these or ensure they are present) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark overlay */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal.open {
    display: flex;
    opacity: 1;
}
.modal-content {
    background-color: var(--content-bg);
    color: var(--primary-text);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 850px; /* Increased max-width for side-by-side plans */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}
.modal.open .modal-content {
    transform: scale(1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}
/* Revert Title to Yellow/Gold */
#plan-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--heading-color) !important; 
}
.modal-body {
    padding: 0 0 10px 0; /* Adjust padding */
}

/* ------------------------------------------- */
/* --- NEW PLAN GRID LAYOUT --- */
/* ------------------------------------------- */

.plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for Basic and Pro */
    gap: 25px;
    margin-bottom: 20px;
}

.plan-card {
    background-color: var(--sidebar-bg); /* Slightly darker background for the card */
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    
    /* Gradient Border setup */
    border: 3px solid transparent; 
    background-clip: padding-box;
    background-origin: border-box;
    /* Inner color is the default background */
    background-image: 
        linear-gradient(to bottom, var(--sidebar-bg), var(--sidebar-bg)),
        /* Outer border is the gradient */
        var(--gradient-bg); 
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat;
    background-position: center center, center center;
}
.plan-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* CURRENT PLAN HIGHLIGHT */
.plan-card.current-plan {
    /* Subtle blue/purple tint background for the active plan */
    background-image: 
        linear-gradient(to bottom, rgba(37, 117, 252, 0.05), rgba(37, 117, 252, 0.05)),
        var(--gradient-bg);
}

/* PLAN HEADERS */
.plan-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}
.plan-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-text) !important; /* Plan Name in White */
    margin: 0;
}
.plan-tag {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--heading-color); /* Yellow Tag for "BEST VALUE" or similar */
    margin-top: 5px;
}

/* PRICE STYLING */
.plan-price-block {
    margin-bottom: 30px;
}

/* CORRECTED: Price is now clearly visible in WHITE */
.plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-text) !important; /* Set to WHITE */
    display: inline-block;
}

.plan-price-block span {
    color: var(--muted-text);
    font-size: 1rem;
    font-weight: 400;
    margin-left: 5px;
}

/* FEATURES LIST */
.plan-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    flex-grow: 1; /* Pushes the button to the bottom */
}
.plan-card ul li {
    padding: 10px 0;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    border-bottom: 1px dashed rgba(60, 64, 81, 0.5); /* Lighter border */
}
.plan-card ul li:last-child {
    border-bottom: none;
}
.plan-card ul li i {
    margin-right: 12px;
    font-size: 1.1em;
    /* Yellow Tick Marks */
    color: var(--heading-color) !important; 
}
/* Cross symbol remains distinct (using your error color or pink) */
.plan-card ul li i.fa-times-circle {
    color: var(--error-color) !important; 
}

/* BUTTON CONTAINER - Aligns button to the right/end */
.plan-button-container {
    text-align: right; /* Aligns the button right */
    padding-top: 15px;
}

/* ------------------------------------------- */
/* --- MODAL FOOTER & CANCEL BUTTON FIX --- */
/* ------------------------------------------- */

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 0; /* Remove top margin */
}

/* FIX: Ensure there's no blank space (margin issue) */
#plan-modal .modal-body > div:last-child { 
    margin-bottom: 0 !important;
}

/* Responsive adjustment for small screens */
@media (max-width: 768px) {
    .plan-grid {
        grid-template-columns: 1fr; /* Stack plans vertically */
    }
}
.btn-cancel-plan {
    background: transparent;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-cancel-plan:hover {
    background: #ff4d4d;
    color: white;
}
/* ==========================================================================
   MOBILE TOUCH OPTIMIZATION GATEWAY
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent the layout from collapsing on narrow screens */
    .dashboard-layout {
        grid-template-columns: 1fr !important;
        padding: 12px !important;
        gap: 16px !important;
    }

    /* Expand button touch zones to meet standard accessibility guidelines (minimum 44px) */
    button, 
    .instagram-post-card,
    .nav-links a {
        min-height: 44px !important;
        padding: 12px !important;
    }

    /* Make the calendar grid easily scrollable on mobile screens */
    .calendar-grid {
        overflow-x: auto !important;
        display: block !important;
        white-space: nowrap !important;
    }
}