/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Container */
.container {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Navigation */
.left-nav {
    width: 200px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.nav-header h2 {
    color: #ecf0f1;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.nav-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-tabs li {
    margin-bottom: 5px;
}

.nav-tab {
    display: flex;
    align-items: center;
    padding: 6px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    /* border-left: 3px solid transparent; */
    font-weight: 500;
    border-radius: 16px;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    border-left-color: #3498db;
}

.nav-tab.active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-left-color: #3498db;
}

/* Main Content */
.main-content {
    flex: 1;
    /* margin-left: 200px; */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.container-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    /* min-height: 100vh; */
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    position: relative;
    /* margin-bottom: 30px; */
}

header h1 {
    font-size: 2 rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

.subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e9ecef;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #007bff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.theme-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    /* margin-bottom: 15px; */
    padding-bottom: 10px;
    /* border-bottom: 1px solid #dee2e6; */
}

.nav-link {
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #495057;
    background-color: #e9ecef;
}

.nav-link.active {
    color: #007bff;
    background-color: #e7f1ff;
}

/* Main content */
main {
    flex: 1;
}

.tool-container {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.input-output-section {
    display: flex;
    flex-direction: row;
    gap: 15px;
    /* align-items: flex-start; */
    /* width: 100%; */
}

.input-output-only {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* align-items: flex-start; */
    height: 40vh;
}

/* Input and Output sections */
.input-section {
    background: white;
    padding: 20px;
    /* margin-bottom: 15px; */
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 350px;
}

.output-section {
    background: white;
    padding: 20px;
    /* margin-bottom: 15px; */
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 40vh;
}

.input-section label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
}

.output-section label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
}

.output-section-vin {
    background: white;
    padding: 20px;
    /* margin-bottom: 15px; */
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* height: 40vh; */
}

.output-section-vin label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
}

.output-section-vin label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
}

textarea {
    flex: 1;
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    min-height: 150px;
}

textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea[readonly] {
    background-color: #f8f9fa;
    cursor: default;
}

textarea::placeholder {
    color: #6c757d;
}

#json-input {
    flex: 1;
    width: 100%;
    padding: 15px;
    /* border: 2px solid #e9ecef; */
    border-radius: 8px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    height: 65vh;
}
#json-output {
    flex: 1;
    width: 100%;
    padding: 15px;
    /* border: 2px solid #e9ecef; */
    border-radius: 8px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    height: 65vh;
}
/* Options section */
.options-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 350px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.options-section:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.options-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1 rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.options-section h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
}

.option-group {
    /* margin-bottom: 24px; */
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    /* border: 1px solid rgba(0,123,255,0.1); */
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
}

.option-group:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 123, 255, 0.2);
    transform: translateX(2px);
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group>label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Quote Style Buttons */
.quote-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quote-btn {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.quote-btn:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.3);
    color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.quote-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.3);
}

.quote-btn.active:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.4);
}

/* Checkboxes */
input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #007bff;
    cursor: pointer;
}

label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #495057;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 123, 255, 0.1);
}

label:has(input[type="checkbox"]):hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.2);
    transform: translateX(2px);
    color: #007bff;
}

label:has(input[type="checkbox"]:checked) {
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
    color: #007bff;
    font-weight: 600;
}

/* Output actions */
.output-actions {
    /* margin-top: 15px; */
    display: flex;
    gap: 10px;
    padding-bottom: 15px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#copy-btn {
    background-color: #007bff;
    color: white;
    flex: 1;
}

#copy-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

#copy-btn:active {
    transform: translateY(0);
}

#clear-btn {
    background-color: #6c757d;
    color: white;
    flex: 1;
}

#clear-btn:hover {
    background-color: #545b62;
    transform: translateY(-1px);
}

#clear-btn:active {
    transform: translateY(0);
}

/* Success message for copy */
.copy-success {
    background-color: #28a745 !important;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.9rem;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .tool-container {
        flex-direction: column;
        gap: 20px;
    }

    .options-section {
        position: static;
        order: -1;
        width: 100%;
        min-width: auto;
    }

    header h1 {
        font-size: 2rem;
    }

    nav {
        gap: 15px;
        flex-wrap: wrap;
    }

    .container {
        padding: 15px;
    }

    .input-section,
    .output-section,
    .options-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .output-actions {
        flex-direction: column;
    }

    nav {
        flex-direction: column;
        align-items: center;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .quote-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .quote-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .label,
body.dark-mode label {
    color: #e0e0e0;
}

body.dark-mode .container-inner {
    background-color: #1a1a1a;
}

body.dark-mode header h1 {
    color: #ffffff;
}

body.dark-mode .subtitle {
    color: #b0b0b0;
}

body.dark-mode .theme-toggle {
    background: rgba(30, 30, 30, 0.9);
    border-color: #444;
    color: #fff;
}

body.dark-mode .theme-toggle:hover {
    background: rgba(40, 40, 40, 1);
    border-color: #007bff;
}

body.dark-mode .input-section,
body.dark-mode .output-section,
body.dark-mode .output-section-vin {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .options-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .options-section h3 {
    color: #ffffff;
}

body.dark-mode .option-group {
    background: rgba(40, 40, 40, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .option-group:hover {
    background: rgba(50, 50, 50, 0.8);
    border-color: rgba(0, 123, 255, 0.3);
}

body.dark-mode .option-group>label {
    color: #e0e0e0;
}

body.dark-mode select {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode select:hover,
body.dark-mode select:focus {
    background: #2d2d2d;
    border-color: #007bff;
}

body.dark-mode textarea {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

body.dark-mode textarea::placeholder {
    color: #888;
}

body.dark-mode .quote-btn {
    background: rgba(40, 40, 40, 0.6);
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .quote-btn:hover {
    background: rgba(0, 123, 255, 0.15);
    border-color: rgba(0, 123, 255, 0.4);
    color: #007bff;
}

body.dark-mode .quote-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    color: white;
}

body.dark-mode label:has(input[type="checkbox"]) {
    background: rgba(40, 40, 40, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode label:has(input[type="checkbox"]):hover {
    background: rgba(0, 123, 255, 0.15);
    border-color: rgba(0, 123, 255, 0.3);
    color: #007bff;
}

body.dark-mode label:has(input[type="checkbox"]:checked) {
    background: rgba(0, 123, 255, 0.2);
    border-color: #007bff;
    color: #007bff;
}

body.dark-mode #copy-btn,
body.dark-mode #clear-btn {
    background-color: #007bff;
    color: white;
}

body.dark-mode #copy-btn:hover {
    background-color: #0056b3;
}

body.dark-mode #clear-btn {
    background-color: #6c757d;
}

body.dark-mode #clear-btn:hover {
    background-color: #545b62;
}

body.dark-mode footer {
    border-color: #444;
    color: #b0b0b0;
}

body.dark-mode footer a {
    color: #007bff;
}

/* VIN Generator Specific Styles */
.vin-layout {
    flex-direction: row;
}

.vin-generator-section {
    background: white;
    padding: 20px;
    /* margin-bottom: 15px; */
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 440px;
}

.vin-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.generate-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.generate-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea68a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.disclaimer {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    color: #856404;
}

/* Dark mode for VIN generator */
body.dark-mode .vin-generator-section {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .generate-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

body.dark-mode .disclaimer {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}

/* Dark mode for left navigation */
body.dark-mode .left-nav {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Ad Sidebar */
.ad-sidebar {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Ad Containers */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 8px;
    border: 1px dashed #dee2e6;
    position: relative;
}

.ad-container::before {
    content: "Advertisement";
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-right {
    width: 160px;
    height: 600px;
    position: sticky;
    top: 20px;
    margin: 0;
}

/* Dark mode ad containers */
body.dark-mode .ad-container {
    background: rgba(45, 45, 45, 0.5);
    border-color: #444;
}

body.dark-mode .ad-container::before {
    color: #888;
}

/* Info Section */
.info-section {
    margin: 40px 0 20px 0;
    padding: 30px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.info-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-content h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.info-content h3 {
    color: #495057;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
}

.info-content p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.info-content ul,
.info-content ol {
    color: #6c757d;
    line-height: 1.6;
    margin-left: 20px;
}

.info-content li {
    margin-bottom: 5px;
}

/* Dark mode info section */
body.dark-mode .info-section {
    background: rgba(45, 45, 45, 0.8);
    border-color: #444;
}

body.dark-mode .info-content h2 {
    color: #ffffff;
}

body.dark-mode .info-content h3 {
    color: #e0e0e0;
}

body.dark-mode .info-content p,
body.dark-mode .info-content ul,
body.dark-mode .info-content ol {
    color: #b0b0b0;
}

/* Responsive Design for Navigation */
@media (max-width: 768px) {
    .left-nav {
        width: 100%;
        height: auto;
        position: static;
        background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%);
    }

    .nav-tabs {
        display: flex;
        justify-content: space-around;
    }

    .nav-tabs li {
        flex: 1;
        margin-bottom: 0;
    }

    .nav-tab {
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 5px;
        font-size: 14px;
    }

    .nav-tab:hover {
        border-bottom-color: #3498db;
        border-left-color: transparent;
    }

    .nav-tab.active {
        border-bottom-color: #3498db;
        border-left-color: transparent;
    }

    .main-content {
        margin-left: 0;
    }

    .tool-container {
        flex-direction: column;
    }

    .vin-layout {
        flex-direction: column;
    }

    .ad-sidebar {
        width: 100%;
        order: -1;
    }

    .ad-right {
        width: 100%;
        height: 90px;
        position: static;
        margin: 15px 0;
    }
}