:root {
    /* Windows 10 (default) */
    --win-blue: #0078d7;
    --win-gray: #f0f0f0;
    --win-border: #adadad;
    --win-hover: #e5f1fb;
    --win-active: #cce4f7;
    --win-titlebar: #0078d7;
    --win-button-gray: #e1e1e1;
    --win-border-radius: 0;
    --win-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --win-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --win-titlebar-height: 32px;
    --win-title-font-weight: normal;
    --win-title-font-size: 12px;
    --win-titlebar-buttons-style: var(--win-titlebar);
    --win-titlebar-text: white;
    --win-titlebar-close-hover: #e81123;
    --win-button-shadow: none;
    --win-titlebar-button-size: 46px;
    --win-content-padding: 24px 20px;
    --win-buttons-padding: 16px 20px;
    --win-buttons-bg: #f0f0f0;
    --win-buttons-border-top: 1px solid #dfdfdf;
}

/* Windows 98 theme */
.theme-win98 {
    --win-blue: #000080;
    --win-gray: #c0c0c0;
    --win-border: #808080;
    --win-hover: #dadada;
    --win-active: #b0b0b0;
    --win-titlebar: linear-gradient(to right, #000080 0%, #000080 100%);
    --win-button-gray: #c0c0c0;
    --win-border-radius: 0;
    --win-shadow: none;
    --win-font: 'MS Sans Serif', 'Microsoft Sans Serif', Tahoma, sans-serif;
    --win-titlebar-height: 18px;
    --win-title-font-weight: bold;
    --win-title-font-size: 11px;
    --win-titlebar-buttons-style: var(--win-button-gray);
    --win-titlebar-text: white;
    --win-titlebar-close-hover: #ff0000;
    --win-button-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #ffffff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
    --win-titlebar-button-size: 16px;
    --win-content-padding: 8px;
    --win-buttons-padding: 8px;
    --win-buttons-bg: #c0c0c0;
    --win-buttons-border-top: none;
}

.theme-win98 .popup-window {
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

.theme-win98 .popup-buttons {
    background: #c0c0c0;
    border-top: none;
    padding: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* All other win98 styles are delegated to 98.css library */

.theme-win98 .popup-close {
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-win98 .popup-close span {
    color: #000;
    font-weight: bold;
}

/* Windows 10 theme */
.theme-win10 {
    --win-blue: #0078d7;
    --win-gray: #ffffff;
    --win-border: #cccccc;
    --win-hover: #e5f1fb;
    --win-active: #cce4f7;
    --win-titlebar: #ffffff;
    --win-button-gray: #ffffff;
    --win-border-radius: 0;
    --win-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --win-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --win-titlebar-height: 32px;
    --win-title-font-size: 12px;
    --win-content-padding: 24px 20px;
    --win-buttons-padding: 20px;
    --win-buttons-bg: #f0f0f0;
    --win-buttons-border-top: 1px solid #dfdfdf;
    --win-titlebar-text: #000000;
    --win-titlebar-button-size: 46px;
}

.theme-win10 .popup-window {
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    min-width: 320px;
    max-width: 400px;
    background: white;
}

.theme-win10 .popup-titlebar {
    background: #ffffff;
    padding: 0 0 0 16px;
    height: 32px;
    border-bottom: 1px solid #dfdfdf;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #000000;
}

.theme-win10 .popup-close {
    width: 46px;
    height: 32px;
    background: transparent;
    color: #666666;
    font-family: "Segoe UI", sans-serif;
    font-size: 10px;
    margin: 0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-win10 .popup-close:hover {
    background-color: #e81123;
    color: white;
}

.theme-win10 .popup-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 20px;
    background: #ffffff;
}

.theme-win10 .popup-message {
    font-size: 12px;
    line-height: 1.4;
    color: #000000;
}

.theme-win10 .popup-buttons {
    padding: 20px;
    background: #f0f0f0;
    border-top: 1px solid #dfdfdf;
    justify-content: flex-end;
    gap: 8px;
}

.theme-win10 .popup-button {
    background: #e1e1e1;
    border: 1px solid #adadad;
    border-radius: 0;
    padding: 5px 20px;
    min-width: 86px;
    height: 24px;
    font-size: 12px;
    font-family: "Segoe UI", sans-serif;
    color: #000000;
    margin: 0;
    cursor: pointer;
}

.theme-win10 .popup-button:hover {
    background-color: #e5f1fb;
    border-color: #0078d7;
}

.theme-win10 .popup-button.primary-button {
    background-color: #0078d7;
    color: white;
    border-color: #0078d7;
}

/* Windows 11 theme */
.theme-win11 {
    --win-blue: #0067C0;
    --win-gray: #ffffff;
    --win-border: #e5e5e5;
    --win-hover: #f5f5f5;
    --win-active: #e5e5e5;
    --win-titlebar: #ffffff;
    --win-button-gray: #ffffff;
    --win-border-radius: 8px;
    --win-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --win-font: 'Segoe UI Variable', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --win-titlebar-height: 32px;
    --win-content-padding: 24px 20px;
    --win-buttons-padding: 20px;
    --win-buttons-bg: #f0f0f0;
    --win-buttons-border-top: 1px solid #dfdfdf;
    --win-titlebar-text: #000000;
    --win-titlebar-button-size: 46px;
}

.theme-win11 .popup-window {
    border: 1px solid #dfdfdf;
    border-radius: 8px;
    min-width: 320px;
    max-width: 400px;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.theme-win11 .popup-titlebar {
    background: #ffffff;
    padding: 0 0 0 12px;
    height: 32px;
    border-bottom: 1px solid #dfdfdf;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-win11 .popup-close {
    width: 46px;
    height: 32px;
    background: transparent;
    color: #666666;
    font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
    font-size: 10px;
    margin: 0;
    border-radius: 0 8px 0 0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-win11 .popup-close:hover {
    background-color: #e81123;
    color: white;
}

.theme-win11 .popup-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 20px;
    background: #ffffff;
}

.theme-win11 .popup-message {
    font-size: 12px;
    line-height: 1.4;
    color: #000000;
    font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
}

.theme-win11 .popup-buttons {
    padding: 20px;
    background: #f0f0f0;
    border-top: 1px solid #dfdfdf;
    justify-content: flex-end;
    gap: 8px;
    border-radius: 0 0 8px 8px;
}

.theme-win11 .popup-button {
    background: #e1e1e1;
    border: 1px solid #adadad;
    border-radius: 4px;
    padding: 5px 20px;
    min-width: 86px;
    height: 24px;
    font-size: 12px;
    font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
    color: #000000;
    margin: 0;
    cursor: pointer;
}

.theme-win11 .popup-button:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: #0067C0;
}

.theme-win11 .popup-button.primary-button {
    background-color: #0067C0;
    color: white;
    border-color: #0067C0;
}

* {
    box-sizing: border-box;
    font-family: var(--win-font);
}

body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-header {
    background: #1a1a1a;
    color: #fff;
    padding: 24px 40px;
    text-align: center;
}

.app-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.app-header p {
    margin: 4px 0 0;
    color: #ccc;
}

.app-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    gap: 20px;
    padding: 20px;
}

.editor-section {
    flex: 1;
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.preview-section {
    flex: 1;
    background: #fdfdff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

h1 {
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
}

h2 {
    color: #1a1a1a;
    margin-top: 0;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
    margin-bottom: 24px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #444;
}

input[type="text"], 
select, 
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--win-blue, #0078d7);
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.2);
}

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

select {
    background-color: white;
}

.button-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.remove-button {
    background-color: #fde8e6;
    color: #c42b1c;
    border: 1px solid #f8d0cb;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.remove-button:hover {
    background-color: #f8d0cb;
    color: #a02116;
}

.add-button {
    background-color: #e9f3fe;
    color: #005a9e;
    border: 1px solid #d0e4fa;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    margin-top: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.add-button:hover {
    background-color: #d0e4fa;
}

.generate-button {
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background-color 0.2s;
}

.generate-button:hover {
    background-color: #005a9e;
}

.export-button {
    background-color: #e9f3fe;
    color: #005a9e;
    border: 1px solid #d0e4fa;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background-color 0.2s;
}

.export-button:hover {
    background-color: #d0e4fa;
}

.popup-preview {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    overflow: hidden;
}

.preview-popup-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Windows Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-window {
    background-color: #fff;
    border-radius: var(--win-border-radius);
    box-shadow: var(--win-shadow);
    min-width: 280px;
    max-width: 420px;
    overflow: hidden;
    animation: popup-appear 0.2s ease-out;
    border: 1px solid var(--win-border);
    position: relative;
}

@keyframes popup-appear {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-titlebar {
    background: var(--win-titlebar);
    color: var(--win-titlebar-text);
    padding: 2px 2px 2px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--win-title-font-size);
    font-weight: var(--win-title-font-weight);
    height: var(--win-titlebar-height);
    line-height: 1;
    user-select: none;
}

.popup-titlebar .title-bar-text {
    flex-grow: 1;
}

.popup-close {
    background: var(--win-titlebar-buttons-style);
    border: none;
    color: var(--win-titlebar-text);
    font-size: 14px;
    cursor: pointer;
    width: var(--win-titlebar-button-size);
    height: calc(var(--win-titlebar-height) - 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px 2px 2px 0;
    font-family: inherit;
}

.popup-close:hover {
    background-color: var(--win-titlebar-close-hover);
}

.popup-content {
    padding: var(--win-content-padding);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: white;
}

.popup-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-top: 2px;
}

.popup-message {
    flex-grow: 1;
    line-height: 1.3;
    font-size: 11px;
    margin: 0;
}

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    padding: var(--win-buttons-padding);
    gap: 6px;
    background-color: var(--win-buttons-bg);
    border-top: var(--win-buttons-border-top);
}

.popup-button {
    padding: 3px 16px;
    background-color: var(--win-button-gray);
    border: 1px solid var(--win-border);
    border-radius: var(--win-border-radius);
    cursor: pointer;
    font-size: 11px;
    min-width: 75px;
    height: 23px;
    box-shadow: var(--win-button-shadow);
    font-family: inherit;
    line-height: 1;
}

.popup-button:hover {
    background-color: var(--win-hover);
}

.popup-button:active, .popup-button.active {
    background-color: var(--win-active);
}

.primary-button {
    background-color: var(--win-blue);
    color: white;
    border-color: var(--win-blue);
}

.primary-button:hover {
    background-color: #106ebe;
}

.primary-button:active, .primary-button.active {
    background-color: #005a9e;
}

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

.export-buttons {
    display: none;
}

.export-button {
    background-color: #1a1a1a;
    color: white;
    border: 1px solid #1a1a1a;
}

.export-button:hover {
    background-color: #333;
    border-color: #333;
}

.hidden {
    display: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .preview-section {
        margin-top: 20px;
    }
}