/* Base styles */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --accent-color: #9b59b6;
    --accent-dark: #8e44ad;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-gray: #f5f7fa;
    --medium-gray: #ddd;
    --dark-gray: #7f8c8d;
    --text-color: #333;
    --light-text: #666;
    --body-font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 4px;
    --webapp-color: #3498db;
    --extension-color: #9b59b6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: var(--light-gray);
    line-height: 1.5;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
}

/* Header */
header {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 0.5rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 32px;
}

.logo h1 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.cta-buttons {
    display: flex;
    align-items: center;
}

.web-app-button {
    background-color: var(--webapp-color);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
}

.web-app-button:hover {
    background-color: var(--primary-dark);
    text-decoration: none;
}

.install-button {
    background-color: var(--extension-color);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.install-button:hover {
    background-color: var(--accent-dark);
    text-decoration: none;
}

/* Main content */
main {
    min-height: calc(100vh - 180px);
    padding-bottom: 3rem;
    flex: 1 0 auto !important;
}

footer {
    flex-shrink: 0 !important; /* Prevent footer from shrinking */
}

.primary-button {
    background-color: var(--webapp-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s;
}

.primary-button:hover {
    background-color: var(--primary-dark);
    text-decoration: none;
}

.secondary-button {
    background-color: var(--extension-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s;
}

.secondary-button:hover {
    background-color: var(--accent-dark);
    text-decoration: none;
}

/* App container */
.app-container {
    max-width: 1200px;
    margin: 2rem auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: calc(100vh - 60px) !important; /* Subtract footer height */
    display: flex !important;
    flex-direction: column !important;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: var(--secondary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-button.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.extension-promo {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(155, 89, 182, 0.1);
    border-radius: var(--border-radius);
    text-align: center;
}

.extension-promo p {
    margin-bottom: 1rem;
}

.secondary-link {
    color: var(--extension-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.secondary-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* Form styling */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--body-font);
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.feedback-section {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.feedback-section p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--light-text);
}

.hidden {
    display: none;
}

/* Footer */
/* Conditional footer display */
@media (min-width: 769px) {
    /* Desktop: Show a more compact footer */
    footer {
        background-color: var(--secondary-color);
        color: white;
        padding: 1rem;  /* Reduced from 2rem */
    }
    
    .footer-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
        padding-bottom: 0.75rem;  /* Reduced from 1.5rem */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer-logo img {
        height: 24px;  /* Reduced from 30px */
    }
    
    .copyright {
        padding-top: 0.75rem;  /* Reduced from 1.5rem */
        font-size: 0.8rem;  /* Reduced from 0.9rem */
    }
}

@media (max-width: 768px) {
    /* Mobile: Hide footer since we have bottom tabs */
    footer {
        display: none;
    }
    
    /* Even smaller header for mobile */
    header {
        padding: 0.3rem 0.5rem;
    }
    
    .logo img {
        height: 24px;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    /* Adjust container to account for bottom tabs */
    main.app-container {
        margin-bottom: 60px;  /* Space for bottom tabs */
        margin-top: 0.5rem;  /* Reduced from 2rem */
    }
    
    /* For smaller screens, reduce the header content padding */
    .header-content {
        padding: 0;
    }
    
    /* Make tabs more responsive on smaller screens */
    .app-container .tabs:not([class*="bottom-"]) {
        display: none;  /* Hide the regular tabs, we use bottom tabs instead */
    }
}

/* Remove extension button and adjust header */
.extension-promo {
    display: none !important; /* Hide the extension promo completely */
}

/* Desktop: Dual sticky header and tabs */
@media (min-width: 769px) {
    /* Make header visible and sticky */
    header {
        display: block !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        background-color: white !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
        padding: 8px 20px !important;
        min-height: 40px !important;
    }
    
    /* Keep the header content compact and centered */
    .header-content {
        max-width: 1200px !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 !important;
    }
    
    /* Compact logo for desktop */
    .logo h1 {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }
    
    .logo img {
        height: 28px !important;
    }
    
    /* Main container consistent width */
    .app-container {
        overflow: visible !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        width: 100% !important;
        background-color: white !important;
        box-shadow: var(--shadow) !important;
        border-radius: var(--border-radius) !important;
    }
    
    /* Tabs with consistent width matching content */
    .tabs {
        position: sticky !important;
        top: 40px !important;
        width: 100% !important;
        max-width: 1200px !important;  /* Match content width */
        margin: 0 auto !important;      /* Center the tabs */
        z-index: 1000 !important;
        background-color: var(--secondary-color) !important;
        display: flex !important;
    }
    
    /* Make tabs equal width */
    .tab-button {
        flex: 1 !important;
        text-align: center !important;
    }
    
    /* Adjust content padding */
    .tab-content {
        width: 100% !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 2rem !important;
        box-sizing: border-box !important;
    }
    
    /* Form elements should stretch within their container */
    input[type="text"],
    textarea,
    select,
    .form-control {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Content elements consistent width */
    .form-group, 
    .job-item, 
    .info-text,
    .search-buttons,
    .toggle-section {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Hide footer as per Phase 3 requirements */
    footer {
        display: none !important;
    }
}

/* Mobile: Keep header but with reduced height */
@media (max-width: 768px) {
    /* Make header extra compact */
    header {
        padding: 0.25rem !important;
        height: auto !important;
    }
    
    .header-content {
        padding: 3px !important;
    }
    
    .logo img {
        height: 20px !important;
    }
    
    .logo h1 {
        font-size: 0.9rem !important;
        margin-bottom: 0 !important;
    }
    
    /* Adjust main container to account for smaller header */
    main.app-container {
        margin-top: 0.25rem !important;
    }
}

/* Mobile-optimized tabs */
@media (max-width: 480px) {
    .tabs {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 0.85rem;
        flex: 0 0 auto;
    }
    
    /* Smaller header for mobile */
    .header-content {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .logo img {
        height: 30px;
    }
    
    /* Smaller footer for mobile */
    .footer-content {
        padding: 15px 10px;
    }
    
    /* Make job cards more mobile-friendly */
    .job-item {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    /* Text size adjustments for mobile */
    .form-label, label {
        font-size: 0.9rem;
    }
    
    input[type="text"],
    textarea,
    select {
        font-size: 16px; /* Prevents iOS zoom when focusing on inputs */
        padding: 10px;
    }
    
    /* Larger buttons for touch targets */
    .primary-button, 
    .secondary-button, 
    .default-button, 
    .danger-button {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Save instructions styling */
    .save-instructions {
        margin-top: 10px;
        font-size: 0.85rem;
    }
    
    .save-instructions summary {
        cursor: pointer;
        color: #3498db;
    }
    
    .save-instructions-content {
        padding: 10px;
        background-color: #f8f9fa;
        border-radius: 4px;
        margin-top: 5px;
    }
}

/* Make job action buttons easier to tap on mobile */
@media (max-width: 768px) {
    .job-actions-container {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
    }
    
    .action-group-title {
        font-size: 16px;
    }
}

/* Mobile tabs as fixed bottom navigation */
@media (max-width: 768px) {
    /* Hide footer on mobile */
    footer {
        display: none !important;
    }
    
    /* Make header smaller */
    header {
        padding: 0.5rem !important;
    }
    
    .header-content {
        padding: 5px !important;
    }
    
    .logo img {
        height: 24px !important;
    }
    
    .logo h1 {
        font-size: 1rem !important;
    }
    
    /* Adjust main content to account for bottom tabs */
    main.app-container {
        margin-bottom: 70px !important;
        margin-top: 1rem !important;
    }
    
    /* CORRECTED: Fix tabs horizontal layout and position at bottom */
    .tabs {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        background-color: white !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        display: flex !important;
        flex-direction: row !important; /* Ensure horizontal layout */
        justify-content: space-around !important;
        height: 60px !important;
        border-top: 1px solid #eee !important;
    }
    
    /* IMPORTANT: Hide the default tabs that are at the top */
    .app-container > .tabs:first-of-type {
        display: flex !important; /* Keep this at flex to override any display:none */
        position: fixed !important; /* Ensure it's fixed position */
        bottom: 0 !important; /* Position at bottom, not top */
        top: auto !important; /* Ensure it doesn't stick to top */
    }
    
    /* Make sure tab buttons are visible and properly styled */
    .tab-button {
        flex: 1 1 20% !important; /* Each button takes 20% (for 5 tabs) */
        max-width: 20% !important; /* Prevent expanding beyond 20% width */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 60px !important;
        padding: 5px 2px !important;
        font-size: 0.7rem !important;
        background-color: white !important;
        color: #777 !important;
        border: none !important;
        border-top: 3px solid transparent !important;
    }
    
    .tab-button.active {
        background-color: white !important;
        color: var(--primary-color) !important;
        border-top: 3px solid var(--primary-color) !important;
    }
    
    /* Base styles for tab button icons */
    .tab-button:before {
        content: '' !important;
        display: block !important;
        width: 24px !important;
        height: 24px !important;
        margin-bottom: 4px !important;
        background-size: 24px !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* Tab icons using SVG as background - with !important flags */
    .tab-button[data-tab="find"]:before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
    }
    
    .tab-button[data-tab="apply"]:before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3Cline x1='16' y1='13' x2='8' y2='13'%3E%3C/line%3E%3Cline x1='16' y1='17' x2='8' y2='17'%3E%3C/line%3E%3Cpolyline points='10 9 9 9 8 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    }
    
    .tab-button[data-tab="profile"]:before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E") !important;
    }
    
    .tab-button[data-tab="insights"]:before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'%3E%3C/line%3E%3Cline x1='12' y1='20' x2='12' y2='4'%3E%3C/line%3E%3Cline x1='6' y1='20' x2='6' y2='14'%3E%3C/line%3E%3C/svg%3E") !important;
    }
    
    .tab-button[data-tab="learning"]:before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'%3E%3C/path%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'%3E%3C/path%3E%3C/svg%3E") !important;
    }
    
    /* Adjust content padding */
    .tab-content {
        padding: 1rem !important;
    }

    /* Add spacing at the bottom to prevent content from being hidden under tabs */
    .tab-content::after {
        content: '';
        display: block;
        height: 70px !important; /* Slightly more than tab height */
    }
    
    /* Fix any z-index issues with modals */
    .modal {
        z-index: 2000 !important; /* Higher than the bottom tabs */
    }
    
    /* Ensure the active tab button is visible */
    .tab-button.active:before {
        color: var(--primary-color) !important;
    }
}

.preview-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .preview-buttons {
        flex-direction: column;
    }
    
    .preview-buttons button {
        width: 100%;
    }
}

.apply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .apply-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .apply-header button {
        margin-top: 10px;
    }
}

.job-filters {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.job-filters label {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.pagination-controls.hidden {
    display: none;
}

#page-info {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

/* Authentication styles */
.auth-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.auth-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-button:hover {
    background-color: #3367d6;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.sign-out-button {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.sign-out-button:hover {
    background-color: #f5f5f5;
}

.sync-status {
    font-size: 12px;
    color: #666;
}

.hidden {
    display: none !important;
}

/* Mobile: Enhanced header with auth elements */
@media (max-width: 768px) {
    /* Keep header compact but ensure auth elements fit */
    header {
        padding: 0.5rem !important;
        background-color: white !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }
    
    .header-content {
        padding: 5px; /* Keep user's padding */
        flex-wrap: wrap; /* Allow .logo and .auth-container to wrap if header-content is too narrow */
        gap: 8px; /* Keep user's gap for .header-content children */
    }

    .auth-container {
        display: flex;
        align-items: center;   /* Vertically center items within auth-container */
        flex-wrap: nowrap;     /* CRUCIAL: Prevent items inside .auth-container from wrapping to new lines */
        flex-shrink: 1;        /* Allow .auth-container itself to shrink if space is tight next to the logo */
        min-width: 0;          /* Essential for flex-shrink to work effectively and allow truncation */
        /* Removed gap from here; will use margin on children for more control if needed */
        font-size: 0.85rem;    /* Keep user's font-size */
    }

    /* Styling for the Sign-in Button OR the User Profile block when visible */
    .auth-container > .auth-button,
    .auth-container > .user-profile {
        flex-shrink: 1;         /* Allow this element (button or profile block) to shrink */
        min-width: 0;           /* Allows it to shrink smaller than its content's natural width */
        white-space: nowrap;    /* Keep content on one line */
        overflow: hidden;       /* Hide overflow */
        text-overflow: ellipsis;/* Show '...' if content is too long */
        margin-right: 8px;      /* Space between this element and the sync status */
    }

    /* Specifics for the Sign-in button if it needs different padding/font from its general class */
    .auth-container > .auth-button {
        padding: 6px 10px; /* Slightly reduced padding for extremely small screens if needed */
        font-size: 12px;
    }

    /* Specifics for the user profile block (avatar, name, sign-out) */
    .auth-container > .user-profile {
        /* user-profile already has display:flex and gap from general styles, which is fine */
        /* Ensure it doesn't grow and also shrinks/truncates */
        flex-grow: 0;
    }

    /* Styling for the user's name SPAN within the user-profile block */
    .auth-container #user-name { /* Targeting the span directly */
        display: inline-block; /* Or block, if it's the only text element */
        max-width: 60px;       /* Adjust this based on testing for very small screens */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle; /* Align with avatar if needed */
        font-size: 12px;       /* Consistent with other mobile header text */
    }

    /* Styling for the sync status text */
    .auth-container .sync-status {
        flex-shrink: 0;         /* Prevent sync status text ("Offline", "Synced") from shrinking/wrapping */
        white-space: nowrap;
        font-size: 11px;        /* Keep user's font-size */
        /* color: #666; /* Already defined in general .sync-status */
    }
    
    /* Smaller auth button for mobile */
    .auth-button {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    /* Compact user profile for mobile */
    .user-profile {
        gap: 6px !important;
    }
    
    .user-profile img {
        width: 24px !important;
        height: 24px !important;
    }
    
    #user-name {
        font-size: 12px !important;
        max-width: 80px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* Compact sync status */
    .sync-status {
        font-size: 11px !important;
    }
    
    /* Sign out button */
    .sign-out-button {
        padding: 2px 6px !important;
        font-size: 11px !important;
    }
}

/* Subscription Section Styles */
.subscription-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--medium-gray);
}

#subscription-status-details p {
    margin-bottom: 0.5rem;
}

#subscription-options {
    margin-top: 1rem;
}

.plan-card-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.plan-card {
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    flex: 1; /* Distribute space equally */
    min-width: 250px; /* Minimum width before wrapping */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.plan-card h5 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.plan-interval {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--light-text);
}

.plan-description {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    flex-grow: 1; /* Pushes button to bottom */
}

.subscribe-button {
    width: 100%;
    padding: 0.8rem;
    margin-top: auto; /* Pushes button to bottom if content above varies */
}

#user-plan-expiry.hidden,
#subscription-options.hidden,
#manage-subscription-options.hidden {
    display: none !important;
}