:root {
    --bg-dark: #0a0a0c;
    --bg-panel: #1a1a20;
    --text-main: #ffffff;
    --text-muted: #8a8a93;
    --accent: #00e5ff;
    --accent-hover: #00b3cc;
    --border: #2a2a35;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* LEFT PANEL */
.left-panel {
    width: 400px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.sidebar-logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sidebar-header-text h1 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.row {
    display: flex;
    gap: 15px;
}

.form-group.row .col {
    flex: 1;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.08);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.primary-select {
    background-color: var(--accent) !important;
    color: #000 !important;
    border: none !important;
    font-weight: 800 !important;
    padding: 14px 15px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

.primary-select:hover {
    background-color: var(--accent-hover) !important;
}

.primary-select option {
    background-color: var(--bg-panel);
    color: var(--text-main);
    font-weight: 400;
}

/* Background Selector */
.background-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bg-option {
    flex: 1 1 30%;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.bg-option input {
    display: none;
}

.bg-option img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
    opacity: 0.6;
    transition: all 0.2s;
}

.bg-option span {
    position: absolute;
    bottom: 5px;
    left: 5px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 4px;
}

.bg-option input:checked + img {
    opacity: 1;
}

.bg-option:has(input:checked) {
    border-color: var(--accent);
}


.btn-primary {
    width: 100%;
    background-color: var(--accent);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

/* RIGHT PANEL */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle, #2a2a35 0%, #0a0a0c 100%);
    padding: 40px;
    padding-top: 100px;
    position: relative;
    overflow-y: auto;
}

.validation-message {
    width: 100%;
    max-width: 800px;
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.top-nav {
    position: fixed;
    top: 30px;
    right: 40px;
    display: flex;
    gap: 30px;
    align-items: center;
    z-index: 1000;
}

.top-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.2s;
}

.top-nav a:hover,
.top-nav a.active {
    color: var(--text-main);
}

.top-nav .nav-auth-btn {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px 22px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.top-nav .nav-auth-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.hidden {
    display: none !important;
}

.mobile-only {
    display: none !important;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 5px;
    z-index: 1100;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-panel);
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    padding: 30px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.mobile-sidebar.active {
    right: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.mobile-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-sidebar-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.linkedin-feed-card {
    width: 100%;
    max-width: 800px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
}

.feed-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.feed-profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.feed-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.feed-user-info strong {
    font-size: 15px;
    color: var(--accent);
    letter-spacing: 0.2px;
}

.feed-user-info span {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 3px;
}

.feed-follow-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feed-follow-btn:hover {
    color: var(--accent-hover);
}

.feed-footer {
    display: flex;
    justify-content: space-around;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.feed-action {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.feed-action.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.feed-action.liked {
    color: var(--accent);
}

.feed-action:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
.feed-action.highlight {
    background-color: var(--accent);
    color: #000;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 229, 255, 0.3);
}
.feed-action.highlight:hover {
    background-color: var(--accent-hover);
}

.preview-wrapper {
    width: 100%;
    aspect-ratio: 1.414 / 1;
    background-color: #000;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    /* Removed border and radius so it fits perfectly edge-to-edge in the card */
}

.preview-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: var(--theme-bg, #0a0a0c);
    border-left: var(--theme-border, none);
    overflow: hidden;
}

/* Base Theme Variables */
.preview-canvas {
    --theme-bg: #0a0a0c;
    --theme-text: #fff;
    --theme-text-muted: #eee;
    --theme-accent: #00e5ff;
    --theme-overlay: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 100%);
    --theme-heading: var(--theme-accent);
    --theme-apply-bg: var(--theme-accent);
    --theme-apply-text: #000;
    --theme-apply-subtext: #fff;
}

/* Theme 1: Default Dark/Teal */
.theme-1 {
    --theme-bg: #0a0a0c;
    --theme-accent: #00e5ff;
}

/* Theme 2: Light Blue/Circle */
.theme-2 {
    --theme-bg: #f8f9fa;
    --theme-text: #333;
    --theme-text-muted: #555;
    --theme-accent: #0b3d91;
    --theme-overlay: none;
    --theme-apply-text: #fff;
    --theme-apply-subtext: #333;
}

/* Theme 3: Light Green/Circle */
.theme-3 {
    --theme-bg: #fdfdfd;
    --theme-text: #222;
    --theme-text-muted: #444;
    --theme-accent: #2e7d32;
    --theme-overlay: none;
    --theme-apply-text: #fff;
    --theme-apply-subtext: #333;
}

/* Theme 4: Dark Navy/Yellow */
.theme-4 {
    --theme-bg: #06112a;
    --theme-text: #fff;
    --theme-text-muted: #ccc;
    --theme-accent: #ffc107;
    --theme-overlay: linear-gradient(to right, rgba(6,17,42,0.9) 0%, rgba(6,17,42,0.6) 100%);
    --theme-border: 12px solid var(--theme-accent);
}

/* Theme 5: Dark Green/Light Green */
.theme-5 {
    --theme-bg: #0f291e;
    --theme-text: #fff;
    --theme-text-muted: #ddd;
    --theme-accent: #8bc34a;
    --theme-overlay: linear-gradient(to right, rgba(15,41,30,0.85) 0%, rgba(15,41,30,0.4) 100%);
}

/* Theme 6: Modern Purple */
.theme-6 {
    --theme-bg: #121212;
    --theme-text: #fff;
    --theme-text-muted: #aaa;
    --theme-accent: #b388ff;
    --theme-overlay: linear-gradient(135deg, rgba(18,18,18,0.95) 0%, rgba(18,18,18,0.6) 100%);
    --theme-apply-bg: var(--theme-accent);
    --theme-apply-text: #000;
    --theme-apply-subtext: #fff;
}

/* Theme 7: Light Coral */
.theme-7 {
    --theme-bg: #fdfbf7;
    --theme-text: #222;
    --theme-text-muted: #555;
    --theme-accent: #ff6b6b;
    --theme-overlay: linear-gradient(to right, rgba(253,251,247,0.9) 0%, rgba(253,251,247,0.7) 100%);
    --theme-border: 10px solid var(--theme-accent);
    --theme-apply-bg: var(--theme-accent);
    --theme-apply-text: #fff;
    --theme-apply-subtext: #222;
}

/* Theme 8: Custom Upsell */
.theme-8 {
    --theme-bg: #1a1a20;
    --theme-text: #fff;
    --theme-text-muted: #aaa;
    --theme-accent: #ff4081;
    --theme-overlay: rgba(0,0,0,0.6);
    --theme-apply-bg: var(--theme-accent);
    --theme-apply-text: #fff;
    --theme-apply-subtext: #eee;
}

/* Theme 9: Clean Minimalist White */
.theme-9 {
    --theme-bg: #ffffff;
    --theme-text: #1a1a1a;
    --theme-text-muted: #4a4a4a;
    --theme-accent: #007bff; /* Vibrant Blue */
    --theme-overlay: rgba(255, 255, 255, 0.7);
    --theme-border: 12px solid var(--theme-accent);
    --theme-apply-bg: var(--theme-accent);
    --theme-apply-text: #fff;
    --theme-apply-subtext: #1a1a1a;
}

.theme-9 .content-overlay {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-9 #preview-title {
    color: #000;
}

.theme-9 .meta-label {
    color: var(--theme-accent);
}

.theme-9 #preview-email {
    color: var(--theme-accent);
}

.theme-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.theme-circle-bg {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    display: none;
    border: 8px solid #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.theme-2 .theme-circle-bg, .theme-3 .theme-circle-bg {
    display: block;
}

.theme-decorations {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-size: cover;
    background-position: center;
}

/* Custom Design Blur Overlay */
.custom-design-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(10, 10, 12, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.theme-8 .custom-design-overlay {
    display: flex;
}

.theme-8 .content-overlay {
    filter: blur(12px);
    pointer-events: none;
}

.custom-design-overlay h2 {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Text Overlay Styling to match sample output */
.content-overlay {
    position: absolute;
    inset: 0;
    background: var(--theme-overlay);
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center the content */
    padding: 60px;
    z-index: 2;
    box-sizing: border-box;
    gap: 12px; /* Reduced from 20px to tighten layout */
}

.header-section {
    margin-bottom: 5px; /* Reduced from 20px */
    flex-shrink: 0;
}

#preview-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--theme-heading);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 15px;
    max-width: 80%;
}

.meta-info {
    font-size: 18px;
    font-weight: 600;
}

.meta-label {
    color: var(--theme-text);
}

#preview-location, #preview-salary {
    color: var(--theme-text-muted);
    font-weight: 400;
}

.meta-separator {
    margin: 0 10px;
    color: var(--theme-text-muted);
}

.body-section {
    flex-shrink: 0;
    min-height: 0;
    margin-bottom: 10px;
}

#preview-body {
    font-size: 18px; /* Reduced from 20px to fit more text */
    line-height: 1.5;
    color: var(--theme-text);
    max-width: 100%;
}

.desc-intro {
    margin-bottom: 10px;
    font-weight: 800; /* Increased weight to match title style */
    color: var(--theme-heading);
    text-transform: uppercase; /* Match title style */
    font-size: 16px;
    letter-spacing: 1px;
}

.desc-help {
    font-size: 14px;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 15px;
    opacity: 0.8;
}

.theme-2 .header-section, .theme-3 .header-section,
.theme-2 #preview-body, .theme-3 #preview-body, 
.theme-2 .footer-section, .theme-3 .footer-section {
    max-width: 55%; /* Ensure title, text, and button don't hit the circle image */
}

.theme-2 .footer-section, .theme-3 .footer-section {
    justify-content: flex-start; /* Align button to the left in these themes */
    margin-top: 10px;
}

/* List Item Styles */
.list-item {
    display: flex;
    align-items: flex-start; /* Align bullet with top of text */
    margin-top: 15px;
    gap: 12px;
}

.list-number {
    font-weight: 800;
    color: var(--theme-accent);
    flex-shrink: 0;
    margin-top: 4px; /* Slight offset to align with text center-line */
}

/* Theme 2 List Style */
.theme-2 .list-item {
    background-color: #f0f0f5;
    border-radius: 30px;
    padding-right: 20px;
    width: fit-content;
}
.theme-2 .list-number {
    background-color: var(--theme-accent);
    color: #fff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 0;
    font-size: 14px;
}

/* Theme 3 List Style */
.theme-3 .list-item {
    border-bottom: none; /* Remove old dashed line */
    padding-bottom: 0;
    margin-top: 12px;
}
.theme-3 .list-number {
    color: var(--theme-accent);
    font-size: 24px;
    line-height: 1;
    margin-top: -2px;
}

/* Theme 6 List Style */
.theme-6 .list-item {
    border-left: 4px solid var(--theme-accent);
    padding-left: 12px;
}
.theme-6 .list-number {
    display: none;
}

/* Theme 7 List Style */
.theme-7 .list-item {
    gap: 12px;
    margin-top: 12px;
}
.theme-7 .list-number {
    background-color: var(--theme-accent);
    color: #fff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-top: 0;
    font-size: 14px;
}

.footer-section {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.apply-box {
    text-align: center;
}

.apply-text {
    display: block;
    background-color: var(--theme-apply-bg);
    color: var(--theme-apply-text);
    font-weight: 800;
    font-size: 24px;
    padding: 10px 40px;
    margin-bottom: 5px;
    border-radius: 6px;
}

.apply-subtext {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-apply-subtext);
}

#preview-email {
    font-weight: 800;
    color: var(--theme-accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-panel);
    padding: 40px;
    border-radius: var(--radius);
    width: 400px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.modal h2 {
    margin-bottom: 10px;
    color: var(--accent);
}

.modal p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.modal .modal-note {
    font-size: 12px;
    font-style: italic;
    margin-bottom: 20px;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.btn-secondary {
    flex: 1;
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.auth-buttons .btn-primary {
    flex: 1;
    margin-top: 0;
}

/* Generated Caption Section */
.caption-container {
    width: 100%;
    background-color: transparent;
    padding: 20px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    position: relative; /* For absolute positioning of edit button */
}

.btn-edit-icon {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 5;
}

.btn-edit-icon:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.btn-edit-icon.editing {
    color: var(--accent);
}

.caption-container.hidden {
    display: none !important;
}

.caption-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-hover);
}

.caption-content textarea {
    width: 100%;
    min-height: 80px;
    background-color: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    padding: 0;
}

.caption-content textarea:focus {
    outline: none;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    body {
        overflow: auto;
        height: auto;
    }
    
    .container {
        flex-direction: column;
        height: auto;
    }
    
    .left-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px;
    }
    
    .right-panel {
        padding: 20px;
        padding-top: 100px;
        min-height: 100vh;
    }
    
    .top-nav {
        position: relative;
        top: 0;
        right: 0;
        left: 0;
        margin-top: 20px;
        margin-bottom: 20px;
        justify-content: center;
        gap: 15px;
        width: 100%;
        z-index: 100;
    }
    
    .top-nav a {
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .top-nav {
        display: none !important;
    }

    .mobile-menu-btn {
        display: block;
        order: 2;
    }
    
    .sidebar-header {
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .right-panel {
        padding: 15px;
        padding-top: 20px;
    }
    
    /* Adjust Preview Canvas for Mobile */
    .content-overlay {
        padding: 20px;
        gap: 5px;
    }
    
    #preview-title {
        font-size: 18px;
        margin-bottom: 5px;
        max-width: 100%;
    }
    
    .meta-info {
        font-size: 11px;
    }
    
    .meta-separator {
        margin: 0 5px;
    }
    
    #preview-body {
        font-size: 11px;
    }

    .list-item {
        margin-top: 5px;
        gap: 6px;
    }
    
    .desc-intro {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .desc-help {
        font-size: 10px;
        margin-bottom: 5px;
    }
    
    .apply-text {
        font-size: 14px;
        padding: 6px 15px;
        margin-bottom: 2px;
    }
    
    .apply-subtext {
        font-size: 9px;
    }
    
    .theme-2 .header-section, .theme-3 .header-section,
    .theme-2 #preview-body, .theme-3 #preview-body, 
    .theme-2 .footer-section, .theme-3 .footer-section {
        max-width: 100%;
    }

    .theme-circle-bg {
        width: 120px;
        height: 120px;
        right: 5px;
        opacity: 0.2;
    }
    
    .background-options {
        gap: 10px;
    }

    .bg-option {
        flex: 1 1 45%;
    }

    .theme-thumb {
        height: 60px !important;
    }

    .theme-4, .theme-9, .theme-7 {
        --theme-border: 4px solid var(--theme-accent);
    }

    .mobile-only {
        display: block !important;
    }

    #mobile-theme-select {
        background-color: var(--bg-panel);
        color: var(--text-main);
        border: 1px solid var(--border);
        padding: 14px;
        font-weight: 600;
        appearance: auto; /* Use system dropdown on mobile for better usability, but keep our colors */
    }

    #mobile-theme-select option {
        background-color: var(--bg-panel);
        color: var(--text-main);
    }

    .desktop-only {
        display: none !important;
    }
}
