/* --- Styles for the Admin Dashboard --- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #eefbfb;
    color: #333;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #fdfaf3;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/skybg.jpg'); 
    background-repeat: repeat;
    background-attachment: fixed;
    
}

/* --- Header --- */
.header {
    background: white;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* NEW: Styles for the profile avatar in the header */
.header-profile-avatar-link {
    display: flex; /* Ensures avatar is centered if it's the only thing in logo div */
    align-items: center;
    justify-content: center;
    text-decoration: none; /* Remove underline from link */
}

.header-profile-avatar {
    width: 50px; /* Adjust size as desired for the header */
    height: 50px;
    border-radius: 50%; /* Make it circular */
    background-size: cover;
    background-position: center;
    background-color: #eee; /* Fallback background color */
    border: 2px solid #fff; /* Small white border */
    box-shadow: 0 0 5px rgba(0,0,0,0.2); /* Subtle shadow */
    display: flex; /* For centering SVG default avatar */
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.header-profile-avatar:hover {
    transform: scale(1.05); /* Slight grow on hover */
}

/* NEW: Styles for the default avatar SVG in the header */
.header-profile-avatar.default-avatar {
    background-image: none !important; /* Ensure no background image when SVG is used */
    background-color: #777; /* Darker background for default icon in header */
    color: #fff; /* White SVG icon */
}

.header-profile-avatar.default-avatar svg {
    width: 60%; /* SVG fills 60% of the avatar div */
    height: 60%;
    fill: currentColor;
}

/* Old .header .logo img style will no longer apply to this avatar, but keep for other pages */
.header .logo img {
    height: 72px; /* Keep this if other pages use it */
    display: block;
}

/* NEW: Wrapper for profile avatar and text in header */
.header .logo { /* Re-purpose the existing .logo flex container */
    display: flex;
    align-items: center;
    gap: 15px; /* Space between avatar and text info */
    flex-grow: 1; /* Allow logo area to grow */
}

/* NEW: Container for name and bio text in header */
.header-profile-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text to the left */
    justify-content: center;
    line-height: 1; /* Helps with vertical spacing */
}

/* NEW: Styles for the profile avatar in the header */
.header-profile-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

.header-profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.header-profile-avatar:hover {
    transform: scale(1.05);
}
.header-profile-avatar.default-avatar {
    background-image: none !important;
    background-color: #777;
    color: #fff;
}
.header-profile-avatar.default-avatar svg {
    width: 60%;
    height: 60%;
    fill: currentColor;
}


/* =================================================================== */
/* --- V2: PROFESSIONAL HEADER DROPDOWN MENU --- */
/* =================================================================== */

.user-menu {
    position: relative; /* This is the anchor for the dropdown */
}

/* 1. The Main Dropdown Button (Avatar-Only Style) */
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the avatar inside */
    
    /* Make the button a perfect circle */
    width: 63px;
    height: 63px;
    border-radius: 50%;
    
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 4px; /* A small padding inside the circle */
    cursor: pointer;
    transition: background-color 0.2s;
}
.menu-btn:hover, .dropdown:hover .menu-btn {
    background-color: #e9ecef;
}

.header-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}
.header-avatar.default-avatar {
    background-color: #ced4da;
    color: #495057;
    padding: 4px;
    box-sizing: border-box; /* Ensure padding is inside the 28px */
}

/* This new rule ensures the SVG inside scales correctly */
.header-avatar.default-avatar svg {
    width: 100%;
    height: 100%;
}

.menu-btn-text {
    font-weight: 600;
    color: #343a40;
}

.menu-arrow {
    font-size: 0.9em;
    color: #6c757d;
}

/* 2. The Dropdown Content Panel */
.dropdown-content {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position it right below the button */
    right: 0;
    background-color: white;
    min-width: 240px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid #e9ecef;
    z-index: 100;
    margin-top: 8px; /* A small gap between button and panel */
    overflow: hidden; /* To clip the rounded corners */
}

/* Show the dropdown on hover of the main .dropdown container */
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

/* 3. The New Dropdown Header */
.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f5;
}
.dropdown-header .user-info {
    display: flex;
    flex-direction: column;
}
.dropdown-header .user-info strong {
    font-size: 1.1rem;
    color: #212529;
}
.dropdown-header .user-info span {
    font-size: 0.9rem;
    color: #6c757d;
}
.dropdown-header .status-badge-wrapper {
    margin-top: 0.75rem;
}
.dropdown-header .status-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

/* 4. Dropdown Links */
.dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #495057;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}
.dropdown-content a:hover {
    background-color: #f8f9fa;
    color: #212529;
}
.dropdown-content a.logout-link {
    border-top: 1px solid #f1f3f5;
    color: #dc3545; /* Red for logout */
}
.dropdown-content a.logout-link:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* --- Dropdown Icons --- */
.dropdown-content a {
    display: flex; /* Aligns icon and text */
    align-items: center;
    gap: 10px; /* Space between icon and text */
}

.menu-icon {
    width: 20px;
    height: 20px;
    fill: #6c757d; /* Muted gray for icons */
    transition: fill 0.2s;
}

/* Change icon color on hover */
.dropdown-content a:hover .menu-icon {
    fill: #212529; /* Darker on hover */
}
/* Red for logout icon */
.dropdown-content a.logout-link .menu-icon {
    fill: #dc3545;
}

/* --- NEW: Styles for Welcome Block & Public Rack Link --- */

.welcome-block {
    display: flex;
    flex-direction: column; /* Stack the welcome text and link vertically */
    align-items: flex-end; /* Align them to the right */
    text-align: right;
    line-height: 1.3; /* A little more space between lines */
}

.my-rack-link {
    font-size: 0.8rem; /* Make it smaller and more subtle */
    font-weight: 500;
    color: #007bff; /* Use a standard link color */
    text-decoration: none;
    transition: all 0.2s ease;
}

.my-rack-link:hover {
    color: #0056b3; /* Darken on hover */
    text-decoration: underline;
}

/* --- NEW: Styles for Subscription Badge in Header --- */

.welcome-line {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between welcome text and badge */
}

/* Style for the badge specifically in the header */
.status-badge.header-badge {
    padding: 2px 8px; /* Make it smaller and tighter than form badges */
    font-size: 0.75rem; /* Smaller font size */
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle; /* Helps with alignment */
}

/* You already have the color rules (.free-status, etc.) in edit_form_style.css, */
/* but it's good to ensure they are also in admin_style.css for global availability. */

/* --- Styles for Subscription Status Badges --- */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: capitalize;
}
.status-badge.free-status {
    background-color: #d1fae5;
    color: #065f46;
}
.status-badge.pro-status {
    background-color: #fff7ed;
    color: #9a3412;
}
.status-badge.business-status {
    background-color: #e5e7eb;
    color: #1f2937;
}

.status-badge.nz360-status {
    background-color: #dbeafe; /* Pale Blue */
    color: #1e40af; /* Deep Blue Text */
    border: 1px solid #bfdbfe;
}

/* --- Main Container & Page Header --- */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}
/* --- 1. Modify the existing .page-header rule --- */
.page-header {
    display: flex; /* <-- ADD THIS */
    justify-content: space-between; /* <-- ADD THIS */
    align-items: center; /* <-- ADD THIS */
    margin-bottom: 2rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 1rem; /* Add space between items if they wrap */
}

.page-header h1 {
    margin: 0;
}

/* --- 2. Add these NEW rules --- */

/* New wrapper for the buttons */
.page-header > div {
    display: flex;
    gap: 1rem; /* Space between the two buttons */
}

/* Style for the new analytics button (Pink Version) */
.add-new-btn.analytics-btn {
    background-color: #ff7674; /* Pink */
    box-shadow: 0 4px 14px rgba(217, 70, 239, 0.2); /* Subtle magenta glow */
    text-decoration: none;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none; /* Ensure no border is applied */
}

.add-new-btn.analytics-btn:hover {
    background-color: #ed7470; /* Darker Pink on hover */
    transform: translateY(-1px); /* Slight lift on hover */
}

/* Style for the locked version of the button */
.add-new-btn.analytics-btn.locked-feature-link {
    background-color: #e5e7eb; /* A light gray */
    color: #6b7280;
    cursor: help;
}
.add-new-btn.analytics-btn.locked-feature-link:hover {
    background-color: #d1d5db;
}

.add-new-btn {
    background-color: #28a745;
    color: white;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.2s;
    /* NEW: Align text to the center */
    text-align: center; 
    /* NEW: Ensure it behaves like a block element for text-align to work */
    display: block; /* Already applied implicitly by width:80% in HTML, but explicit is better */
}
.add-new-btn:hover { background-color: #218838; }

/* --- START: THE FIX FOR BUTTON TEXT SIZE --- */
.page-header .add-new-btn {
    /* Set a specific, larger font size */
    font-size: 1rem !important; /* ~16px */
    
    /* Ensure consistent padding */
    padding: 0.6rem 1.2rem;
    
    /* Ensure it aligns well with the h1 title */
    vertical-align: middle;
}
/* --- END OF FIX --- */

/* --- Flipbook Grid & Cards (Existing, but ensure consistency) --- */
.flipbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
.flipbook-card {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #fff;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/woodbg3.jpg'); 
    background-repeat: repeat;
    background-attachment: contain;
    
}
.flipbook-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.thumbnail-link {
    display: block;
    position: relative;
}
/* --- REVISED: Styles for "Floating" Thumbnail Effect --- */

/* 1. The Thumbnail Container */
.thumbnail {
    position: relative; /* Still needed for the overlay */
    
    /* THE FIX: Revert to a square aspect ratio */
    aspect-ratio: 1 / 1; 

    /* Use flexbox to center the image inside */
    display: flex;
    justify-content: center;
    align-items: flex-start;

    /* Add padding to create a "frame" around the image */
    padding: 1.2rem; 
    box-sizing: border-box;

    /* These styles from before are still good */
    overflow: hidden; /* We'll hide the view-overlay, not the image */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #f8f9fa; /* Fall back background: A very light, neutral background for the container */
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/woodbg2.jpg'); 
    background-repeat: repeat;
    background-attachment: contain;
    
}

/* --- ENHANCED: Thumbnail Image with 3D "Thickness" Effect --- */
.thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    
    /* Add a subtle border to represent the cover's edge */
    border: 1px solid rgba(0, 0, 0, 0.2);

        /* --- ALTERNATIVE: Side-On Thickness Effect --- */
    box-shadow: 
        /* The right and bottom page edges */
        4px 4px 0px rgba(0, 0, 0, 0.15),
        /* A soft drop shadow behind everything */
        6px 6px 12px rgba(0, 0, 0, 0.2);

    /* The transition will now be smoother */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* --- ENHANCED Hover Effect --- */
.thumbnail-link:hover .thumbnail img {
    transform: scale(1.05) translateY(-5px) rotate(1deg);
    box-shadow:
        6px 6px 0px rgba(0, 0, 0, 0.15),
        8px 8px 16px rgba(0, 0, 0, 0.25);
}

/* The hover effect remains the same and will work perfectly */
.thumbnail-link:hover .thumbnail img {
    transform: scale(1.05) translateY(-5px) rotate(1deg);
    -webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.15), 0 4px 6px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.15), 0 16px 24px rgba(0,0,0,0.15);
            box-shadow: 0 2px 2px rgba(0,0,0,0.15), 0 4px 6px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.15), 0 16px 24px rgba(0,0,0,0.15);
}

.thumbnail-link:hover .thumbnail img {
    /* Lift and rotate the thumbnail slightly on hover */
    transform: scale(1.05) translateY(-5px) rotate(1deg);
    
    /* Make the shadow larger and more diffuse to enhance the "lifted" effect */
    -webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.15), 0 4px 6px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.15), 0 16px 24px rgba(0,0,0,0.15);
            box-shadow: 0 2px 2px rgba(0,0,0,0.15), 0 4px 6px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.15), 0 16px 24px rgba(0,0,0,0.15);
}
.view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.thumbnail-link:hover .view-overlay {
    opacity: 0;
}

/* --- NEW: Styles for Card Overlay on Thumbnails --- */

/* --- V4: STYLES FOR THUMBNAIL OVERLAY (LEFT-ALIGNED) --- */

/* The main overlay container */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 12px;
    
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
    
    /* --- THIS IS THE KEY FIX --- */
    display: flex;
    align-items: center; /* Vertically align all items */
    justify-content: flex-start; /* Align all items to the left */
    gap: 8px; /* Add space between items (stats, separator, author) */
    /* --- END FIX --- */
    
    color: #ffffff;
    font-size: 0.8rem;
    opacity: 1;
}

/* This rule now styles the author name for overflow */
.overlay-author {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* New style for the dot separator */
.overlay-separator {
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.6;
}

/* Reset and style the stats item */
.card-stats {
    margin: 0;
    padding: 0;
    border: none;
}

.card-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-weight: 500;
    flex-shrink: 0; /* Important: prevents the stats from being squashed */
}

.card-stats .stat-item svg {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
    flex-shrink: 0;
}

.card-content {
    padding: 0.8rem 1rem;
    flex-grow: 1;
}
.card-content .title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}
.card-content .author, .card-content .date {
    font-size: 0.8rem;
    color: #777;
    margin: 0;
}
.card-content .author { margin-bottom: 0.5rem; }

.card-actions {
    border-top: 1px solid #f0f0f0;
    padding: 0.6rem 1.2rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
.action-btn {
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
.action-btn.edit {
    background-color: #e0e0e0;
    color: #333;
}
.action-btn.edit:hover { background-color: #d1d1d1; }
.action-btn.delete {
    background-color: #fbecec;
    color: #c51b1b;
}
.action-btn.delete:hover { background-color: #f8d7da; }

.no-results-card {
    background: white;
    padding: 3rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.no-results-card h2 { font-size: 1.5rem; }
.no-results-card p { color: #777; }

/* Responsive styles for the admin dashboard */
@media (max-width: 768px) {
    .container, .header {
        padding: 1rem;
    }
    .user-menu > span {
        display: none; /* Hide "Welcome..." text on small screens */
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .add-new-btn {
        text-align: center;
    }
    .thumbnail {
        /* On mobile, align the image to the top to prevent cropping the title */
        align-items: flex-start;
        
        /* Optional: Reduce padding on mobile to give the image more space */
        padding: 0.9rem 3.6rem;
    }
}


/* MODIFIED: Profile Name Heading (Now styled for within the header) */
.profile-name-heading {
    font-size: 1.2rem; /* Reduced font size */
    margin: 0; /* Remove all margins */
    color: #333; /* Default text color within header */
    text-align: left; /* Ensure left alignment */
    line-height: 1.2;
    /* For profile.php, this will be in the header, so color will be #333.
       If you want it white on the header in profile.php, make this specific:
       .header .profile-name-heading { color: #fffef8; } */
}

/* --- Professional Bio Text Style --- */
.header .profile-bio-text {
    /* Font and Color */
    font-family: 'Arial', serif;
    font-size: 0.75rem;
    color: #666 !important; /* A lighter, softer gray. Use !important as a final override */
    font-style: normal;

    /* Spacing and Layout */
    margin-top: 4.5px;
    margin-bottom: 0;
    line-height: 1.2;
    max-width: 600px;
    
    white-space: pre-wrap; 
    word-break: break-word;
}

/* NEW: Specific color for profile.php's header text */
/* This ensures the text is white when on profile.php's header */
.header .profile-name-heading,
.header .profile-bio-text {
    color: #333; /* Adjusted to blend with white header */
}


/* Responsive adjustment for profile header on smaller screens */
@media (max-width: 768px) {
    /* MODIFIED: Header specific adjustments for smaller screens */
    .header .logo {
        gap: 10px; /* Reduce gap on small screens */
    }
    .header-profile-avatar {
        width: 40px; /* Smaller header avatar on mobile */
        height: 40px;
        border-width: 1px; /* Thinner border on mobile */
    }
    .header-profile-info-text {
        /* Ensure text wraps or adjusts as needed on small screens */
        font-size: 0.9em; /* Smaller text size for header info on mobile */
    }
    .header.profile-name-heading {
        font-size: 1rem; /* Smaller heading size on mobile */
        margin-top: 0;
        margin-bottom: 1.2px;
    }
    .header.profile-bio-text {
        font-size: 0.6rem; /* Smaller bio text on mobile */
        margin-top: 0;
        line-height: 0.6; /* Slightly tighter line height for mobile */
    }
    .container {
        padding: 0 1rem; /* Adjust container padding for mobile */
    }
}



/* --- Section/Category Titles & Separators (from index.php) --- */
.section-title {
    font-size: 1.5rem;
    color: #444;
    margin-top: 2rem;
    margin-bottom: 0; 
}

/* --- STYLE FOR TAB SECTION DESCRIPTIONS --- */
.section-description {
    font-size: 1rem;
    color: #495057; /* A soft, dark gray */
    background-color: #f8f9fa; /* A very light background to distinguish it */
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
}

.separator-line {
    border-bottom: 2px solid #eee;
    margin-bottom: 1.5rem; 
    padding-bottom: 0; 
}

.no-category-msg {
    font-style: italic;
    color: #777;
    margin-bottom: 2rem;
    padding-left: 10px;
}

/* --- NEW: Styles for Section Header with Link --- */

.section-header {
    display: flex; /* Aligns items side-by-side */
    justify-content: space-between; /* Pushes title to the left and link to the right */
    align-items: flex-end; /* Aligns items to the bottom, looks nice with multi-line titles */
    gap: 1rem; /* Space between title and link */
    margin-bottom: 0.5rem; /* Space before the separator line */
}

/* Make sure the section-title itself has no bottom margin now */
.section-title {
    margin-bottom: 0;
}

.view-public-rack-link {
    background-color: #eefbfb;
    color: #0d6efd;
    border: 1px solid #cfe2ff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap; /* Prevent the link from wrapping */
    transition: all 0.2s ease;
}

.view-public-rack-link:hover {
    background-color: #cfe2ff;
    color: #0a58ca;
    border-color: #b6d4fe;
}

/* --- NEW: Styles for Titles Inside Tab Panels --- */

.tab-panel .tab-content-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-top: 0 !important;
    margin-bottom: 0.25rem !important;
    padding-top: 0.5rem !important;
}

.tab-panel .tab-content-description {
    font-size: 0.95rem !important;
    color: #666 !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

/* --- Responsive Adjustments for Section Header --- */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column; /* Stack title and link vertically */
        align-items: flex-start; /* Align both to the left */
    }
}

/* --- Privacy Badges (from index.php) --- */
.privacy-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px; 
}

.privacy-badge.public-status {
    background-color: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb;
}

.privacy-badge.listed-status {
    background-color: #cce5ff; 
    color: #004085; 
    border: 1px solid #b8daff;
}

.privacy-badge.private-status {
    background-color: #d1d0d0; /* gray-100 */
    color: #4b5563; /* gray-600 */
    border: 1px solid #d1d5db;
}
.privacy-badge.password-status {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
    border: 1px solid #fecaca;
}
.privacy-badge.business-status { /* <-- ADD THIS RULE */
    background-color: #e5e7eb;
    color: #1f2937;
    border: 1px solid #d1d5db;
}
/* In login/css/admin_style.css */

/* --- Site Footer Styles --- */
.site-footer {
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 3rem;
    background-color: #368ec8;
}

.site-footer .footer-content {
    max-width: 1400px; /* Constrain width like .container */
    margin: 0 auto; /* Center the content */
    padding: 0 2rem; /* Add horizontal padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Increased gap for better spacing between sections */
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap; /* Allow links to wrap */
    justify-content: center;
    gap: 10px; /* Space between policy links */
}
.site-footer .footer-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}
.site-footer .footer-links a:hover {
    color: #ff9c3f; 
}

/* NEW: Footer Social Links Container */
.footer-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* Space between social icons */
    margin-top: 10px; /* Space above social links */
    margin-bottom: 10px; /* Space below social links (before copyright) */
}

/* NEW: Individual Social Icon Link */
.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* Size of the icon area */
    height: 36px;
    border-radius: 50%; /* Circular background */
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background for icons */
    transition: background-color 0.2s, transform 0.2s;
    color: #fff; /* Default icon color */
}

.social-icon-link:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Brighter background on hover */
    transform: scale(1.1); /* MODIFIED: Make the icon slightly larger on hover */
    color: #fff; /* Ensure SVGs stay white on hover */
}

/* --- UNIFIED ICON STYLING FOR FOOTER --- */

/* This targets BOTH the SVG and the IMG tags inside the links */
.social-icon {
    width: 24px;  /* Set the desired icon size */
    height: 24px;
}

/* Specific rule for SVGs */
.social-icon:not(.social-icon-img) { /* This targets the SVG but not the IMG */
    fill: currentColor;
}

/* Specific rule for IMGs */
.social-icon-img {
    object-fit: contain; /* Ensures the image scales without distortion */
}

/* Responsive adjustment for footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 1rem 0;
    }
    .site-footer .footer-content {
        padding: 0 1rem; /* Adjust horizontal padding on mobile */
    }
    .site-footer .footer-links {
        flex-direction: column; /* Stack policy links vertically on small screens */
        gap: 5px;
    }
    .site-footer .footer-links a {
        margin: 0;
    }
    .footer-social-links {
        gap: 15px; /* Reduce gap between social icons on mobile */
    }
    .social-icon-link {
        width: 32px; /* Smaller icons on mobile */
        height: 32px;
    }
    .social-icon {
        width: 20px; /* Smaller SVG icons on mobile */
        height: 20px;
    }
    .social-icon-img {
        object-fit: contain; /* Re-assert for safety */
    }
}

/* Admin action button */
.action-btn.feature {
    background-color: #d1e7dd;
    color: #0f5132;
}
.action-btn.feature:hover {
    background-color: #badbcc;
}
.action-btn.unfeature {
    background-color: #fff3cd;
    color: #664d03;
}
.action-btn.unfeature:hover {
    background-color: #ffe69c;
}

/* --- NEW: Styles for Tabbed Interface --- */

/* --- NEW: Orange Theme for Fieldsets in Advanced Editor --- */

/* Target only fieldsets inside our new tab panels */
.tab-panel fieldset {
    border: 1px solid #ffedd5; /* Soft orange border */
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 0; /* Reset default fieldset padding */
}

.tab-panel fieldset legend {
    /* Style the legend like a step-header */
    width: 100%;
    margin: 0;
    padding: 15px 20px;
    font-size: 1.3rem; /* Adjusted size */
    color: #9a3412; /* Deep orange text */
    background-color: #fff7ed; /* Very light orange */
    border-bottom: 1px solid #ffedd5;
    box-sizing: border-box;
}

/* Add padding to the content INSIDE the fieldset */
.tab-panel fieldset > * {
    /* We'll use margin for spacing, so remove padding from all children by default */
    padding: 0; 
}

/* This is the main content area inside the fieldset */
.tab-panel fieldset > legend ~ * {
    /* THE FIX: Use horizontal margin to create padding */
    margin-left: 30px;
    margin-right: 30px;
    
    /* THE FIX: Increase vertical margin for more spacing */
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Remove margin/padding from elements that don't need it */
.tab-panel fieldset > legend,
.tab-panel fieldset > hr {
    margin-left: 0;
    margin-right: 0;
}

/* Special handling for the last element to create bottom padding */
.tab-panel fieldset > *:last-child {
    margin-bottom: 30px;
}

.tab-interface-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 2rem;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #fff;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/paperbg.jpg'); 
    background-repeat: repeat;
    background-attachment: fixed;
    
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* --- Base style for all tab links --- */
.tab-link {
    padding: 15px 25px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab-link:hover {
    background-color: #e9ecef;
    color: #000;
}

/* --- REVISED: Style for SVG Icon inside a Tab Link --- */
.tab-icon-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Specific fix for the Locked/Trigger button to match */
button.trigger-unlock-modal {
    width: auto; /* Allow it to size based on content, not 100% */
    text-align: left;
}

/* Ensure the lock icon is pushed to the right but doesn't break layout */
.trigger-unlock-modal .lock-icon {
    margin-left: 8px;
    font-size: 0.9em;
    opacity: 0.7;
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .tab-nav {
        flex-direction: column;
    }
    .tab-link {
        border-bottom: 1px solid #ddd;
        border-left: 3px solid transparent;
        border-top-right-radius: 8px; /* Adjust for vertical layout */
    }
    .tab-link.active {
        border-bottom-color: #ddd;
        border-left-color: #f97316; /* Use vibrant orange for the active indicator */
    }
    .tab-content {
        padding: 1.5rem 1rem;
    }
}

/* --- Logic for the Heart Icons --- */

/* By default, show the outline and hide the filled heart */
.tab-link .icon-heart-filled {
    display: none;
}
.tab-link .icon-heart-outline {
    display: block;
}

/* When the tab link is ACTIVE, hide the outline and show the filled heart */
.tab-link.active .icon-heart-filled {
    display: block;
}
.tab-link.active .icon-heart-outline {
    display: none;
}

/* --- Color Styling for the Heart Icons --- */

/* Inactive state (outline) will be a neutral gray */
.tab-link .icon-heart-outline {
    color: #e91e63;
}

/* Active state (filled) will be the pink/red color */
.tab-link.active .icon-heart-filled {
    color: #e91e63;
}

/* --- THEME 1: Default/Advanced Editor Active Tab (Orange) --- */
.tab-link.active {
    color: #c2410c; /* Deep orange */
    border-bottom-color: #f97316; /* Vibrant orange */
    background-color: #fff;
}


/* --- THEME 2: Dashboard/Profile Active Tab (Green) --- */
/* This more specific rule will override the default orange on the correct pages */
.dashboard-theme .tab-link.active {
    color: #198754; /* A strong theme green */
    border-bottom-color: #198754;
}

.tab-content {
    padding: 2rem;
}

.tab-panel {
    display: none; /* Hide all panels by default */
}

.tab-panel.active {
    display: block; /* Show only the active panel */
    animation: fadeIn 0.5s;
}

/* --- NEW: Unified Styles for ALL Tab Icons (SVG) --- */
.tab-link svg.tab-icon-svg {
    width: 1.3em;  /* Size the icon relative to the button's font size */
    height: 1.3em;
    margin-right: 0.5rem; /* Space between icon and text */
    vertical-align: middle; /* Align icon nicely with the text */
    /* The color will be inherited from the .tab-link's text color */
}

/* Specific adjustments for the "Liked" tab's dual-icon setup if needed */
/* This ensures your existing heart icons are not negatively affected */
.tab-link .icon-heart-outline,
.tab-link .icon-heart-filled {
    width: 1.3em;
    height: 1.3em;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* --- Main Style for Active Tabs (Orange - Default for Advanced Editor) --- */
.tab-link.active {
    color: #c2410c; /* Deep orange */
    border-bottom-color: #f97316;
    background-color: #fff;
}
/* --- Responsive Styles for Tabs --- */
@media (max-width: 768px) {
    .tab-nav {
        flex-direction: column;
    }
    .tab-link {
        border-bottom: 1px solid #ddd;
        border-left: 3px solid transparent;
    }
    
    /* Responsive active state for Default/Orange theme */
    .tab-link.active {
        border-bottom-color: #ddd;
        border-left-color: #f97316;
    }

    /* Responsive active state for Dashboard/Green theme */
    .dashboard-theme .tab-link.active {
        border-left-color: #198754;
    }
}

/* --- Rule for legacy PNG tab icons --- */
.tab-link .tab-icon-img {
    height: 20px;
    width: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ======================================================= */
/* --- V4: "HIGHLIGHT ON ACTIVE" DASHBOARD TABS        --- */
/* ======================================================= */

/* 1. Main tab link styles */
.tab-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 12px 15px !important;
    border-radius: 6px; /* Add a subtle rounding to the entire button */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; /* Smooth transitions */
}

/* 2. The Icon Wrapper (is now just for spacing and color) */
.tab-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    /* We no longer need size or border-radius as it's invisible */
}

/* 3. The SVG Icon (Consistent styling for both states) */
.tab-icon-wrapper .tab-icon-svg {
    width: 22px;
    height: 22px;
    /* The color is now set thematically and does NOT change on active */
}

/* Thematic colors for ALL icons (active and inactive) */
.tab-icon-wrapper.public svg { color: #15803d; } /* Green */
.tab-icon-wrapper.listed svg { color: #1d4ed8; } /* Blue */
.tab-icon-wrapper.password svg { color: #b91c1c; } /* Red */
.tab-icon-wrapper.private svg { color: #4b5563; } /* Gray */
.tab-icon-wrapper.invited svg { color: #5b21b6; } /* Purple */
.tab-icon-wrapper.liked svg { color: #be185d; } /* Pink */
.tab-icon-wrapper.business svg { color: #4b5563; }


/* 4. The Active Tab State (The Highlight) */
.tab-link.active {
    /* When the tab is active, the ENTIRE button gets a background color */
    background-color: #f0fdf4; /* Your pale green */
    color: #065f46; /* A matching deep green for the text */
    font-weight: 600; /* Make the text slightly bolder */
}

/* We also need a subtle hover effect for inactive tabs */
.tab-link:not(.active):hover {
    background-color: #f8f9fa; /* A very light gray on hover */
}


/* 5. Special handling for the Liked tab's dual icons */
.tab-link .icon-heart-filled { display: none; }
.tab-link.active .icon-heart-outline { display: none; }
.tab-link.active .icon-heart-filled { display: inline-block; }

/* ======================================================= */
/* --- INDIGO THEME OVERRIDES FOR TEAM TABS (Indigo Theme) --- */
/* ======================================================= */

.tab-link.team-theme-tab.active {
    background-color: #e0e7ff !important; /* Indigo-100 */
    color: #4338ca !important;            /* Indigo-700 */
    border-left-color: #4f46e5 !important; /* Indigo-600 */
    border-bottom-color: #4f46e5 !important; 
    font-weight: 600;
}

.tab-link.team-theme-tab.active .tab-icon-wrapper.business svg {
    color: #4338ca !important; /* Force icon color to match text */
}

/* --- NEW: Styles for Pagination --- */

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-nav a,
.pagination-nav span {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #0d6efd;
}

.pagination-nav a:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.pagination-nav .current-page {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    cursor: default;
}

.pagination-nav .disabled {
    color: #6c757d;
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pagination-nav a,
    .pagination-nav span {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* --- NEW: Styles for Category Filter Bar --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    border-radius: 20px;
    text-decoration: none;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #adb5bd;
    color: #000;
}

.filter-btn.active {
    background-color: #198754; /* Your dashboard's green theme color */
    color: white;
    border-color: #198754;
}

/* ======================================================== */
/* --- V2: Unified Style for ALL Locked/Upsell Features --- */
/* ======================================================== */

.locked-feature-link {
    /* 1. The visual cues */
    color: #9ca3af !important; /* Muted gray color */
    cursor: help !important;   /* The '?' cursor */
    opacity: 0.8;

    /* 2. Flex properties to align the lock icon */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.locked-feature-link:hover {
    color: #374151 !important; /* Darken text on hover */
    opacity: 1;
}

.locked-feature-link .lock-icon {
    font-size: 0.8em;
}

.tab-nav a.locked-feature-link {
    text-decoration: none;
    display: flex; /* Ensure flex properties apply to the <a> tag as well */
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}

/* =================================================================== */
/* --- STYLES FOR "CREATE CHOICE" MODAL --- */
/* =================================================================== */

/* These rules for the overlay and base modal are reusable */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Prevent interaction when hidden */
}
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 700px; /* A wider modal for two choices */
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}
.modal-close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 2rem; color: #999;
    background: none; border: none;
    cursor: pointer; line-height: 1;
}
.modal-content h3 {
    margin-top: 0;
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Specific styles for our choice cards */
.creation-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.creation-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
.creation-card:hover {
    border-color: #0d6efd;
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}
.creation-card .modal-icon {
    display: block;
    margin: 0 auto 1rem auto;
    height: 72px;
    width: 72px; /* Set width to match height for a square aspect ratio */
    
    /* Set a nice, professional color for the icons */
    color: #333;
}

.creation-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}
.creation-card p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* ======================================================= */
/* --- V2: RESPONSIVE STYLES FOR CREATE CHOICE MODAL --- */
/* ======================================================= */

@media (max-width: 768px) {
    /* Stack the choice cards into a single column on mobile */
    .creation-choice-grid {
        grid-template-columns: 1fr;
    }

    /* --- THE FIX IS HERE --- */
    /* Adjust the main modal content box for smaller screens */
    .modal-content {
        /* Remove the large max-width on mobile */
        max-width: 90%; 

        /* Reduce the padding to give more space for content */
        padding: 1.5rem; 

        /* Allow the modal to scroll if the content is too tall for the screen */
        max-height: 90vh;
        overflow-y: auto; 
    }

    /* Make the title smaller on mobile */
    .modal-content h3 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    /* Make the card text slightly smaller */
    .creation-card h4 {
        font-size: 1.1rem;
    }
    .creation-card p {
        font-size: 0.9rem;
    }
    /* --- END OF FIX --- */
}

/* --- STYLES FOR THE REUSABLE UPGRADE MODAL --- */

/* The overlay is already styled by your .modal-overlay class, but we can ensure it here */
#upgrade-modal {
    z-index: 9999; /* Ensure it's on top of everything */
}

#upgrade-modal .modal-content {
    text-align: center;
    max-width: 420px;
}

#upgrade-modal .limit-icon {
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 80px;
    height: auto;
}

#upgrade-modal h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

#upgrade-modal p {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 2rem;
}

#upgrade-modal .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Re-use your button styles for consistency */
#upgrade-modal .btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s;
}

#upgrade-modal .btn-primary {
    background-color: #2563eb;
    color: white;
}
#upgrade-modal .btn-primary:hover {
    background-color: #1d4ed8;
}

#upgrade-modal .btn-secondary {
    background-color: #fff;
    color: #374151;
    border-color: #d1d5db;
}
#upgrade-modal .btn-secondary:hover {
    background-color: #f9fafb;
}

/* --- Styles for Blog Management Analytics --- */
.geo-tags {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.geo-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #374151;
}
.geo-tag img {
    width: 16px;
    height: 12px;
}
.no-data {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ========================================= */
/* --- NEW: CREDIT BALANCE WIDGET STYLES --- */
/* --- THEME: FUCHSIA (Sharp Pink/Purple) -- */
/* ========================================= */

.user-menu {
    display: flex;
    align-items: center;
}

.credit-balance-widget {
    margin-right: 20px;
    display: inline-flex;
    align-items: center;
}

.credit-balance-widget a {
    display: flex;
    align-items: center;
    text-decoration: none;
    /* Subtle gradient with a hint of pink */
    background: linear-gradient(to bottom, #ffffff, #fdf4ff);
    border: 1px solid #e879f9; /* Soft Fuchsia Border */
    border-radius: 50px;
    padding: 6px 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(217, 70, 239, 0.1);
}

.credit-balance-widget a:hover {
    border-color: #d946ef; /* Sharper Fuchsia on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(217, 70, 239, 0.25); /* Fuchsia Glow */
}

/* --- SVG Icon Styles --- */
.credit-icon-svg {
    width: 20px;
    height: 20px;
    fill: #d946ef; /* Fuchsia Icon */
    margin-right: 8px;
    flex-shrink: 0;
}

/* Darker icon color on hover */
.credit-balance-widget a:hover .credit-icon-svg {
    fill: #c026d3; /* Darker Fuchsia */
}

.credit-amount {
    font-weight: 700;
    color: #86198f; /* Deep Purple Text for contrast */
    font-size: 0.95rem;
    margin-right: 4px;
    line-height: 1; 
    padding-top: 2px;
}

.credit-label {
    font-size: 0.8rem;
    color: #a21caf; /* Medium Fuchsia Text */
    margin-right: 8px;
    font-weight: 500;
    padding-top: 2px;
}

/* The small "+" button circle */
.buy-plus {
    background-color: #d946ef; /* Fuchsia Background */
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    transition: background-color 0.2s;
}

.credit-balance-widget a:hover .buy-plus {
    background-color: #c026d3; /* Darker Fuchsia on hover */
}

@media (max-width: 600px) {
    .credit-label {
        display: none;
    }
    .credit-balance-widget {
        margin-right: 10px;
    }
}

/* --- Admin Table Credit Widget --- */
.admin-credit-widget {
    display: inline-flex;
    align-items: center;
    background: #fdf4ff; /* Pale Fuchsia bg */
    border: 1px solid #e879f9;
    border-radius: 20px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.admin-credit-widget:hover {
    background-color: #fae8ff;
    border-color: #d946ef;
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(217, 70, 239, 0.2);
}

.admin-credit-widget .credit-icon-svg {
    width: 16px;
    height: 16px;
    fill: #d946ef;
    margin-right: 6px;
}

.admin-credit-widget .amount {
    font-weight: 700;
    color: #86198f; /* Deep Purple */
    margin-right: 6px;
}

.admin-credit-widget .plus-icon {
    background-color: #d946ef;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

/* --- NOTIFICATION WIDGET --- */
.notification-widget {
    position: relative;
    margin-right: 20px;
    display: flex; /* Helps align the button vertically */
    align-items: center;
}

.notif-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    color: #555;
    transition: color 0.2s;
}
.notif-btn:hover { color: #333; }

.notif-icon {
    width: 24px;
    height: 24px;
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #dc3545;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}
.notif-badge.hidden { display: none; }

.notif-dropdown {
    position: absolute;
    top: 100%;
    right: -10px; /* Align slightly right */
    width: 300px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 10px;
}
.notif-dropdown.hidden { display: none; }

.notif-header {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: block; /* Make whole item clickable */
    text-decoration: none;
    color: #333;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background-color: #f9f9f9; }

.notif-item.unread { border-left: 3px solid #007bff; }

.notif-title { font-weight: 600; display: block; margin-bottom: 4px; }
.notif-msg { color: #666; display: block; font-size: 0.85rem; line-height: 1.4; }
.notif-date { display: block; color: #999; font-size: 0.75rem; margin-top: 5px; }

.notif-empty { padding: 20px; text-align: center; color: #999; font-style: italic; }

/* ================================== */
/* --- NEW: Credit Unlocked Badge --- */
/* ================================== */
.credit-unlocked-badge {
    background-color: #fdf4ff !important; /* Pale fuchsia */
    color: #c026d3 !important;            /* Vibrant fuchsia */
    border-color: #f0abfc !important;
}

.credit-unlocked-badge svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    vertical-align: -2px; /* Aligns the icon nicely with text */
    margin-right: 2px;
}

/* ================================================= */
/* --- MOBILE & PWA HEADER OPTIMIZATION --- */
/* ================================================= */

@media (max-width: 768px) {
    
    /* 1. Slimmer Header Container */
    .header {
        padding: 0.5rem 10px; /* Reduce padding on edges */
        height: auto;
        min-height: 60px;
        flex-wrap: nowrap; /* Force items to stay in one row */
        gap: 5px;
    }

    /* 2. Shrink the Logo */
    .header .logo img {
        height: 39px; /* Smaller logo height */
        width: auto;
    }

    /* 3. Tighten the User Menu Group */
    .user-menu {
        gap: 2px; /* Reduce space between widgets */
        justify-content: flex-end;
        flex-grow: 1; /* Allow it to take available space */
    }

    /* 4. Optimize Credit Widget (Compact Mode) */
    .credit-balance-widget {
        margin-right: 4px; /* Tiny margin */
    }
    
    .credit-balance-widget a {
        padding: 4px 8px; /* Smaller padding inside pill */
    }

    .credit-balance-widget .credit-icon-svg {
        width: 16px;
        height: 16px;
        margin-right: 4px;
    }

    .credit-balance-widget .credit-amount {
        font-size: 0.85rem;
        margin-right: 0; /* Remove right margin since other items are hidden */
    }

    /* HIDE non-essential elements on mobile */
    .credit-balance-widget .credit-label, 
    .credit-balance-widget .buy-plus {
        display: none !important;
    }

    /* 5. Optimize Notification Widget */
    .notification-widget {
        margin-right: 8px; /* Reduce margin */
    }
    
    .notif-btn {
        padding: 4px; /* Smaller touch target padding */
    }
    
    .notif-dropdown {
        position: fixed; /* Make dropdown full width on mobile */
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        margin-top: 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    /* 6. Optimize Profile Avatar Button */
    .menu-btn {
        width: 40px;  /* Smaller outer circle */
        height: 40px;
        border-width: 1px;
    }

    .header-avatar {
        width: 32px; /* Smaller inner image */
        height: 32px;
    }
    
    /* Ensure the PWA fix doesn't override this size logic */
    .emma-video-container {
        width: 100px !important; /* Keep Emma reasonable */
        height: 100px !important;
    }
    
    /* 7. Dropdown Mobile Fix */
    /* Ensure the profile dropdown doesn't go off-screen */
    .dropdown-content {
        right: 0; /* Align to right edge */
        width: 250px; /* Prevent it from being too wide */
        max-width: 90vw; /* Ensure it fits on screen */
    }
}

/* Extra tweak for very small screens (iPhone SE, Galaxy Fold) */
@media (max-width: 380px) {
    .header .logo img {
        display: none; /* Hide logo completely on tiny screens if needed */
    }
    /* OR replace text logo with icon only if you have one */
}

