:root {
    --bg-color: #e0e0e0;
    --text-color: #333;
    --heading-color: #2c3e50;
    --container-bg: #fff;
    --card-bg: #f9f9f9;
    --border-color: #eee;
    --topbar-bg: #2c3e50;
    --topbar-text: #ecf0f1;
    --resbar-bg: #fff;
    --resbar-border: #bdc3c7;
    --res-item-color: #555;
    --btn-primary: #3498db;
    --btn-primary-hover: #2980b9;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --heading-color: #ecf0f1;
    --container-bg: #1e1e1e;
    --card-bg: #2d2d2d;
    --border-color: #444;
    --topbar-bg: #000;
    --topbar-text: #bdc3c7;
    --resbar-bg: #2d2d2d;
    --resbar-border: #444;
    --res-item-color: #ccc;
    --btn-primary: #1e88e5;
    --btn-primary-hover: #1565c0;
}

body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--bg-color); color: var(--text-color); margin: 0; padding: 0; transition: background 0.3s, color 0.3s; overflow-x: hidden; }
body.has-bottom-nav { padding-bottom: 70px; } /* Space for bottom nav on mobile */

/* Top Bar - Desktop */
.top-bar-desktop { background: var(--topbar-bg); color: var(--topbar-text); padding: 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); flex-wrap: wrap; gap: 10px; }
.top-bar-desktop a { color: var(--topbar-text); text-decoration: none; margin-left: 10px; font-weight: bold; font-size: 0.9em; }

/* Top Bar - Mobile */
.top-bar-mobile { background: var(--topbar-bg); color: var(--topbar-text); padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; }
.top-bar-mobile .top-bar-logo { font-size: 1.1em; font-weight: bold; display: flex; align-items: center; gap: 6px; }
.top-bar-mobile .btn-link { color: var(--topbar-text) !important; }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--topbar-bg);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 1050;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    color: var(--topbar-text);
    text-decoration: none;
    font-size: 0.75em;
    min-height: 56px;
    transition: background 0.2s, color 0.2s;
    border-top: 3px solid transparent;
}
.bottom-nav-item:hover,
.bottom-nav-item:active {
    background: rgba(255,255,255,0.1);
    color: var(--topbar-text);
}
.bottom-nav-item.active {
    background: rgba(255,255,255,0.15);
    border-top-color: #3498db;
    color: #3498db;
}
.bottom-nav-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.bottom-nav-icon {
    font-size: 1.4em;
    margin-bottom: 2px;
}
.bottom-nav-label {
    font-weight: 600;
    letter-spacing: 0.02em;
}
.bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    font-size: 0.6em;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom Nav Dropup */
.bottom-nav-dropup {
    flex: 1;
    display: flex;
    align-items: stretch;
}
.bottom-nav-dropup .bottom-nav-item {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
}
.bottom-nav-dropdown {
    min-width: 180px;
    padding: 8px 0;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.bottom-nav-dropdown .dropdown-item {
    padding: 12px 16px;
    font-size: 1em;
}
.bottom-nav-dropdown .dropdown-item:hover,
.bottom-nav-dropdown .dropdown-item:focus {
    background: rgba(255,255,255,0.1);
}
.bottom-nav-dropdown .dropdown-item.active {
    background: #3498db;
}

/* Offcanvas Dark Mode Support */
[data-bs-theme="dark"] .offcanvas {
    background: var(--container-bg);
    color: var(--text-color);
}
[data-bs-theme="dark"] .offcanvas .list-group-item {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}
[data-bs-theme="dark"] .offcanvas .list-group-item:hover {
    background: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .offcanvas .list-group-item.active {
    background: #3498db;
    border-color: #3498db;
}

.res-bar { background: var(--resbar-bg); padding: 10px 15px; display: flex; gap: 15px; justify-content: center; border-bottom: 2px solid var(--resbar-border); box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-wrap: wrap; }
.res-item { display: flex; align-items: center; gap: 6px; font-weight: bold; color: var(--res-item-color); font-size: 0.9em; white-space: nowrap; }
.res-item .res-value { font-weight: bold; }
.res-item .res-prod { color: #7f8c8d; font-size: 0.8em; font-weight: normal; }
.res-item .res-prod.coins { color: #f39c12; }
.res-item.storage-info { margin-left: auto; color: #888; font-size: 0.85em; }

.container { padding: 25px; max-width: 900px; margin: 15px auto; background: var(--container-bg); min-height: 500px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow-x: hidden; }

h2, h3 { color: var(--heading-color); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }

/* Auth Pages (Login/Register) */
.auth-wrapper {
    min-height: 70vh;
    background: url('https://images.unsplash.com/photo-1533158307581-2715877119f4?auto=format&fit=crop&q=60&w=1920') no-repeat center center;
    background-size: cover;
    margin: -25px -25px 0 -25px;
    padding: 30px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.auth-wrapper.auth-register {
    background-image: url('https://images.unsplash.com/photo-1599557452656-62164a613d08?auto=format&fit=crop&q=60&w=1920');
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
}

.auth-card-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
}

.auth-card {
    border-radius: 12px;
    overflow: hidden;
}

.auth-card .card-body {
    padding: 25px;
}

.auth-card .input-group-text {
    font-size: 1.1em;
    min-width: 45px;
    justify-content: center;
}

/* Profile Page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.profile-card .card {
    height: 100%;
}

/* Building Cards */
.building-card { 
    border: 1px solid var(--border-color); padding: 15px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap;
    border-radius: 6px; background: var(--card-bg); transition: transform 0.1s;
}
.building-card:hover { transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.building-info { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 0; padding-right: 15px; }
.building-card form { flex-shrink: 0; }

/* Building Details */
.building-details {
    flex: 1;
    min-width: 0;
}

.building-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.building-submenu-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--btn-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    margin-top: 6px;
    transition: background 0.2s;
}

.building-submenu-btn:hover {
    background: var(--btn-primary-hover);
    color: white;
}

.building-desc {
    font-style: italic;
    color: #666;
    font-size: 0.85em;
    margin: 4px 0 8px 0;
    max-width: 500px;
    line-height: 1.4;
}

body.dark-mode .building-desc {
    color: #aaa;
}


/* Responsive Styles */
@media (max-width: 768px) {
    /* Existing Responsive Styles ... */
    .container {
        padding: 15px;
        margin: 10px auto;
        width: 95%;
    }
    /* ... (Assuming previous code is here, modifying specific parts below) */
}

/* Specific Mobile Portrait Map Handling */
@media (max-width: 768px) and (orientation: portrait) {
    .village-grid, .village-map-container {
        display: none !important;
    }
    .mobile-landscape-hint {
        display: block !important;
    }
}
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        max-width: 100%;
        padding: 5px;
    }
    .village-grid {
        /* Allow horizontal scroll if still too big */
        transform: scale(0.8); /* Slight shrink to fit better */
        transform-origin: top center;
        margin-bottom: -100px; /* Compensate for scale gap */
    }
}

/* General Mobile Styles */
@media (max-width: 768px) {
    /* Prevent text overflow globally */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
        margin: 5px auto;
        width: 98%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Auth Pages Mobile */
    .auth-wrapper {
        margin: -10px -10px 0 -10px;
        padding: 20px 10px;
        min-height: 80vh;
    }
    
    .auth-card-container {
        max-width: 100%;
    }
    
    .auth-card .card-body {
        padding: 20px 15px;
    }
    
    .auth-card .card-header h4 {
        font-size: 1.1em;
    }
    
    /* Profile Mobile */
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    h2 {
        font-size: 1.3em;
        word-break: break-word;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    /* Mobile: Hide desktop top-bar, top-bar-mobile is handled by d-md-none */
    
    .res-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 5px;
        justify-content: center;
    }
    .res-item {
        font-size: 0.75em;
        gap: 3px;
        min-width: auto;
        padding: 2px 4px;
        background: rgba(0,0,0,0.05);
        border-radius: 4px;
    }
    .res-item svg {
        width: 14px;
        height: 14px;
    }
    .res-item .res-prod {
        display: none; /* Hide production on very small screens */
    }
    .res-item.storage-info {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        font-size: 0.7em;
    }
    
    /* Buttons */
    .btn {
        padding: 6px 10px;
        font-size: 0.85em;
        white-space: nowrap;
    }
    
    /* Table to Card Transformation */
    table.table, .table tbody, .table tr, .table td, .table th {
        display: block;
        width: 100%;
    }
    .table thead {
        display: none; /* Hide headers */
    }
    .table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        background: var(--card-bg);
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 0.9em;
    }
    .table td:last-child {
        border-bottom: none;
    }
    
    /* Adjust building cards for mobile */
    .building-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .building-info {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
        padding-right: 0;
    }
    .building-info > svg {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
    }
    .building-details {
        flex: 1;
        min-width: 0;
    }
    .building-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .building-header strong {
        font-size: 1em;
        word-break: break-word;
    }
    .building-header .badge {
        font-size: 0.75em;
    }
    .building-submenu-btn {
        display: block;
        width: fit-content;
        margin-top: 8px;
        padding: 6px 12px;
        font-size: 0.85em;
    }
    .building-desc {
        font-size: 0.8em;
        margin: 6px 0;
        max-width: 100%;
    }
    .building-info span {
        font-size: 0.85em;
        line-height: 1.4;
    }
    .building-card .btn {
        width: 100%;
        text-align: center;
    }
    .building-card form {
        width: 100%;
    }
    
    /* Cost display - wrap nicely */
    .building-info .costs,
    span[style*="font-size:0.8em"] {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        font-size: 0.75em !important;
    }
    
    /* Forms */
    form[style*="display:inline-block"] {
        display: block !important;
        margin-top: 10px;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="password"],
    select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Unit cards in barracks */
    div[style*="display:flex"][style*="gap:10px"] {
        gap: 8px !important;
    }
    div[style*="min-width:80px"] {
        min-width: 70px !important;
        padding: 8px !important;
        font-size: 0.85em;
    }
    
    /* Alerts */
    .alert {
        padding: 10px;
        font-size: 0.9em;
    }
    
    /* Map Navigation */
    .nav-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    .nav-controls .btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    /* Reports list */
    .report-row,
    tr[style*="cursor:pointer"] {
        font-size: 0.85em;
    }
    
    /* Dropdowns */
    .dropdown-menu {
        max-width: 90vw;
        font-size: 0.9em;
    }
    
    /* Fix inline forms that cause overflow */
    form[style*="inline"] span[style*="font-size"] {
        display: block;
        margin-top: 5px;
        white-space: normal;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .container {
        padding: 8px;
        margin: 3px;
    }
    
    h2 {
        font-size: 1.1em;
    }
    
    .res-bar {
        gap: 5px;
        padding: 5px;
    }
    .res-item {
        font-size: 0.65em;
        min-width: auto;
        padding: 2px 3px;
    }
    .res-item svg {
        width: 12px;
        height: 12px;
    }
    .res-item .res-prod {
        display: none;
    }
    .res-item.storage-info {
        display: none; /* Hide storage on tiny screens */
    }
    
    .btn {
        padding: 5px 8px;
        font-size: 0.8em;
    }
    
    .building-card {
        padding: 10px;
    }
    
    .building-info > svg {
        width: 32px;
        height: 32px;
    }
    
    .building-header strong {
        font-size: 0.9em;
    }
    
    .building-submenu-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    
    .building-desc {
        font-size: 0.75em;
    }
    
    /* Map grid smaller */
    .map-container {
        max-width: 100% !important;
    }
    .map-tile {
        font-size: 0.5em !important;
    }
    .map-coord {
        display: none;
    }
}

body.dark-mode .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}
body.dark-mode .card-header {
    background-color: #333 !important; /* Force darker header */
    border-bottom-color: var(--border-color);
}
body.dark-mode .table {
    color: var(--text-color);
    border-color: var(--border-color);
}
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #363636;
    color: var(--text-color);
    box-shadow: none; /* remove bootstrap accent */
}
body.dark-mode .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: var(--card-bg);
    color: var(--text-color);
     box-shadow: none;
}

/* Fix Merchant/Dark Mode Inputs */
body.dark-mode .form-control, 
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: #2d2d2d; 
    border-color: #444;
    color: #e0e0e0;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #3d3d3d;
    color: #fff;
    border-color: var(--btn-primary);
}
body.dark-mode .form-control::placeholder {
    color: #888;
}

/* Fix Landing Page Scroll / Safety */
@media (max-width: 768px) {
    .landing-page {
        overflow-y: visible !important;
        height: auto !important;
    }
    /* Allow scrolling on container to prevent lock-up */
    .container {
        overflow-x: visible; 
    }
}
body.dark-mode .text-muted {
    color: #9e9e9e !important;
}
body.dark-mode .dropdown-menu {
    background-color: #333;
    border-color: #555;
}
body.dark-mode .dropdown-item {
    color: #eee;
}
body.dark-mode .dropdown-item:hover {
    background-color: #555;
    color: #fff;
}

/* Fix Dropdown Hover Overflow */
.dropdown-menu {
    overflow: hidden;
    border-radius: 0.375rem; 
}


/* Visual Map */
.village-map-container {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #7ab345; /* Grass */
    background-image: radial-gradient(#8bc34a 20%, transparent 20%);
    background-size: 20px 20px;
    border: 4px solid #5d4037;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    /* Optional: Simple river/road styling could be added via CSS gradients */
}

.map-slot {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    font-size: 0.8rem;
    color: #333;
    font-weight: bold;
}

.map-slot:hover {
    background: #fff;
    border-color: #f1c40f;
    z-index: 10;
    transform: scale(1.1);
}

.map-slot svg {
    margin-bottom: 4px;
}

.map-slot.level-0 {
    opacity: 0.5;
    background: rgba(0,0,0,0.1);
    border: 2px dashed #666;
}

.map-slot span.lvl {
    background: #333;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Upgrade Form Styling */
.upgrade-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.cost-display {
    font-size: 0.85em;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Unit Grid */
.unit-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.unit-card {
    background: var(--card-bg);
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    min-width: 75px;
    flex: 0 0 auto;
}

.unit-card .unit-name {
    font-size: 0.8em;
    color: var(--res-item-color);
}

/* Recruit Card */
.recruit-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.recruit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.recruit-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85em;
    margin-bottom: 10px;
}

.recruit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.recruit-form input[type="number"] {
    width: 70px;
}

@media (max-width: 768px) {
    .upgrade-form {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .upgrade-form .btn {
        width: 100%;
    }
    
    .cost-display {
        font-size: 0.75em;
        justify-content: flex-start;
    }
    
    .unit-grid {
        gap: 8px;
        justify-content: flex-start;
    }
    
    .unit-card {
        min-width: 65px;
        padding: 10px 8px;
        font-size: 0.9em;
    }
    
    .recruit-card {
        padding: 12px;
    }
    
    .recruit-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .recruit-stats {
        font-size: 0.8em;
    }
    
    .recruit-form {
        width: 100%;
    }
    
    .recruit-form input[type="number"] {
        flex: 1;
        min-width: 60px;
    }
    
    .recruit-form .btn {
        flex: 1;
    }
}

/* Send Army Form */
.send-army-form .unit-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.unit-select-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.unit-select-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: bold;
}

.unit-select-name {
    font-size: 0.95em;
}

.unit-select-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8em;
    color: var(--res-item-color);
    margin-bottom: 10px;
}

.unit-select-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.unit-select-input input {
    flex: 1;
    min-width: 60px;
    max-width: 100px;
}

.send-button-container {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.target-info {
    font-size: 0.95em;
    color: var(--res-item-color);
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .send-army-form .unit-selection {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .unit-select-card {
        padding: 10px;
    }
    
    .unit-select-input {
        width: 100%;
    }
    
    .unit-select-input input {
        flex: 1;
        max-width: none;
    }
    
    .send-button-container {
        flex-direction: column;
    }
    
    .send-button-container .btn {
        width: 100%;
        padding: 12px;
    }
}

/* ========== Landing Page ========== */
.landing-page {
    margin: -25px;
}

.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1599557452656-62164a613d08?auto=format&fit=crop&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 3em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    margin-bottom: 15px;
    border: none;
}

.hero-subtitle {
    font-size: 1.3em;
    text-shadow: 1px 1px 2px black;
    margin-bottom: 15px;
    opacity: 0.95;
    border: none;
}

.hero-text {
    font-size: 1.1em;
    text-shadow: 1px 1px 2px black;
    margin-bottom: 25px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    padding: 12px 30px;
    font-weight: bold;
}

/* Features */
.features-section {
    padding: 50px 20px;
    background: var(--container-bg);
}

.section-title {
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--heading-color);
}

.feature-text {
    color: var(--res-item-color);
    font-size: 0.95em;
    line-height: 1.5;
}

/* Preview */
.preview-section {
    padding: 50px 20px;
    background: var(--card-bg);
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    align-items: center;
}

.preview-text h3 {
    font-weight: bold;
    margin-bottom: 20px;
    border: none;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.feature-list li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.ascii-preview {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    font-family: monospace;
    font-size: 1.2em;
    text-align: center;
    line-height: 1.8;
}

.preview-caption {
    text-align: center;
    color: var(--res-item-color);
    font-size: 0.85em;
    margin-top: 10px;
}

/* CTA */
.cta-section {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 50px 20px;
}

.cta-section h3 {
    color: white;
    border: none;
    margin-bottom: 10px;
}

.cta-section p {
    margin-bottom: 25px;
    opacity: 0.9;
}

/* Landing Mobile */
@media (max-width: 768px) {
    .landing-page {
        margin: -10px;
    }
    
    .hero-section {
        min-height: 350px;
        padding: 30px 15px;
    }
    
    .hero-title {
        font-size: 2em;
    }
    
    .hero-subtitle {
        font-size: 1em;
    }
    
    .hero-text {
        font-size: 0.95em;
    }
    
    .hero-buttons .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .features-section {
        padding: 30px 15px;
    }
    
    .section-title {
        font-size: 1.3em;
        margin-bottom: 25px;
    }
    
    .features-grid {
        gap: 15px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 2.5em;
    }
    
    .preview-section {
        padding: 30px 15px;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .ascii-preview {
        font-size: 0.9em;
        padding: 15px;
    }
    
    .cta-section {
        padding: 35px 15px;
    }
    
    .cta-section h3 {
        font-size: 1.3em;
    }
}
