/* ==========================================================================
   Base Theme Variables
   ========================================================================== */
:root {
    --bg-color: #f5f5f5;
    --app-bg: #ffffff;
    --text-color: #333333;
    --border-color: #cccccc;
    --primary-color: #007bff;
    --primary-active: #0056b3;
    --accent-color: #ff8800;
    --accent-active: #cc6600;
    --error-color: #dc3545;
    --error-bg: #f8d7da;
    --success-color: #28a745;
    --success-bg: #d4edda;
    
    --font-family: sans-serif;
    --header-font: sans-serif;
    
    --border-radius: 4px;
    --app-shadow: 0 4px 6px rgba(0,0,0,0.1);
    
    --input-bg: #ffffff;
    --input-border: #cccccc;

    --btn-border: transparent;
    --btn-radius: 4px;
    --btn-shadow: none;
    --btn-active-shadow: none;

    --titlebar-bg: #f8f9fa;
    --titlebar-border: #cccccc;
    --titlebar-text: #333333;
    --titlebar-icon-color: #dc3545;

    --file-drop-border: #cccccc;
    --file-drop-bg: #fafafa;
    
    --progress-bg: #eeeeee;
}

/* ==========================================================================
   Mac Classic Theme Variables
   ========================================================================== */
.theme-maclassic {
    --bg-color: #e5e5e5;
    --app-bg: #eeeeee;
    --text-color: #000000;
    --border-color: #000000;
    --primary-color: #008899; /* bondi-blue */
    --primary-active: #006677;
    --accent-color: #ff6600; /* tangerine */
    --accent-active: #cc5500;
    --error-color: #ff3366; /* strawberry */
    --error-bg: #ffeeee;
    --success-color: #99cc00; /* lime */
    --success-bg: #eeffee;
    
    --font-family: "Geneva", "Verdana", "Helvetica", sans-serif;
    --header-font: "Charcoal", "Chicago", "Arial Black", sans-serif;
    
    --border-radius: 0px;
    --app-shadow: 2px 2px 0px #888888;
    
    --input-bg: #ffffff;
    --input-border: #888888;

    --btn-border: 2px solid #000000;
    --btn-radius: 12px;
    --btn-shadow: inset -1px -1px 2px rgba(0,0,0,0.2), inset 1px 1px 2px rgba(255,255,255,0.8);
    --btn-active-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);

    --titlebar-bg: repeating-linear-gradient(0deg, #cccccc, #cccccc 1px, #eeeeee 1px, #eeeeee 2px);
    --titlebar-border: #000000;
    --titlebar-text: #000000;
    --titlebar-icon-color: #ffffff;

    --file-drop-border: #888888;
    --file-drop-bg: #ffffff;
    
    --progress-bg: #ffffff;
}

/* Mac Classic specific background overrides */
.theme-maclassic {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        #d5d5d5 1px,
        #d5d5d5 2px
    );
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

.theme-switcher-container {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--app-bg);
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--app-shadow);
}

.theme-select {
    font-family: var(--font-family);
    font-size: 0.9rem;
    padding: 4px;
}

.container {
    max-width: 500px;
    width: 100%;
}

.app-container {
    background-color: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--app-shadow);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.app-titlebar {
    background: var(--titlebar-bg);
    border-bottom: 1px solid var(--titlebar-border);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: bold;
    font-family: var(--header-font);
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: var(--titlebar-text);
}

.app-titlebar-icon {
    position: absolute;
    left: 6px;
    width: 12px;
    height: 12px;
    background-color: var(--titlebar-icon-color);
    border: 1px solid var(--titlebar-border);
}

.app-content {
    padding: 16px;
}

h1, h2, h3 {
    font-family: var(--header-font);
    margin-top: 0;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }

.subtitle {
    font-size: 0.9rem;
    color: #444;
}

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

label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: bold;
}

.form-input {
    width: 100%;
    padding: 6px;
    font-family: var(--font-family);
    font-size: 1rem;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    box-sizing: border-box;
    border-radius: var(--border-radius);
}

/* Mac Classic specific overrides for inputs */
.theme-maclassic .form-input {
    border-bottom-color: #ffffff;
    border-right-color: #ffffff;
}

.btn {
    display: inline-block;
    padding: 4px 16px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: bold;
    background-color: var(--app-bg);
    border: var(--btn-border);
    border-radius: var(--btn-radius);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--btn-shadow);
}

.btn:active {
    box-shadow: var(--btn-active-shadow);
    background-color: #dddddd;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:active { background-color: var(--primary-active); }

.btn-accent {
    background-color: var(--accent-color);
    color: white;
}
.btn-accent:active { background-color: var(--accent-active); }

.file-drop {
    border: 2px dashed var(--file-drop-border);
    padding: 24px 16px;
    text-align: center;
    background-color: var(--file-drop-bg);
    margin-bottom: 16px;
    border-radius: var(--border-radius);
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.file-item:last-child { border-bottom: none; }

.file-count {
    margin-top: 12px;
    font-weight: bold;
    color: var(--primary-color);
}

.hidden { display: none !important; }

.progress-bar-wrapper {
    border: 1px solid var(--border-color);
    height: 16px;
    background-color: var(--progress-bg);
    margin-bottom: 4px;
    border-radius: var(--border-radius);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
}

/* Mac Classic override for progress bar */
.theme-maclassic .progress-bar {
    background: repeating-linear-gradient(
        -45deg,
        var(--primary-color),
        var(--primary-color) 10px,
        #00aacc 10px,
        #00aacc 20px
    );
}

.progress-text {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 4px;
}

.error-box {
    border: 2px solid var(--error-color);
    background-color: var(--error-bg);
    padding: 10px;
    color: var(--error-color);
    font-weight: bold;
    margin-bottom: 16px;
    border-radius: var(--border-radius);
}

.success-box {
    border: 2px solid var(--success-color);
    background-color: var(--success-bg);
    padding: 16px;
    text-align: center;
    border-radius: var(--border-radius);
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-right: 12px;
}

.header-flex {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.copy-group { display: flex; gap: 8px; margin-top: 8px; }

/* Button Bar for Radio Buttons */
.button-bar {
    display: flex;
    width: 100%;
    border: 2px solid var(--file-drop-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--app-bg);
}

.button-bar input[type="radio"] {
    display: none;
}

.button-bar label {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    margin: 0;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    border-right: 2px solid var(--file-drop-border);
    background-color: var(--progress-bg);
    color: var(--text-color);
    box-shadow: var(--btn-shadow);
}

.button-bar label:last-child {
    border-right: none;
}

.button-bar input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    box-shadow: inset 1px 1px 4px rgba(0,0,0,0.5);
}

/* ==========================================================================
   Geocities Theme Variables & Overrides
   ========================================================================== */
.theme-geocities {
    --bg-color: #000000;
    --app-bg: #000080; /* Navy blue */
    --text-color: #ffffff;
    --border-color: #ff00ff; /* Magenta borders */
    --primary-color: #ffff00; /* Yellow */
    --primary-active: #cccc00;
    --accent-color: #00ff00; /* Neon green */
    --accent-active: #00cc00;
    --error-color: #ff0000;
    --error-bg: #000000;
    --success-color: #00ff00;
    --success-bg: #000000;
    
    --font-family: "Times New Roman", Times, serif;
    --header-font: "Comic Sans MS", "Comic Sans", "Chalkboard SE", sans-serif;
    
    --border-radius: 0px;
    --app-shadow: 5px 5px 0px #ff00ff;
    
    --input-bg: #ffffff;
    --input-border: #00ffff;
    
    --btn-border: 3px outset #ffff00;
    --btn-radius: 0px;
    --btn-shadow: none;
    --btn-active-shadow: none;

    --titlebar-bg: #ff00ff;
    --titlebar-border: #ffff00;
    --titlebar-text: #ffff00;
    --titlebar-icon-color: #00ff00;

    --file-drop-border: #00ffff;
    --file-drop-bg: #000000;
    
    --progress-bg: #000000;
}

.theme-geocities {
    background-color: #000000;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 4px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 4px);
    background-size: 550px 550px, 350px 350px, 250px 250px; 
    background-position: 0 0, 40px 60px, 130px 270px;
}

.retro-separator {
    display: none;
}

.theme-geocities .container {
    max-width: 800px;
}

.theme-geocities .app-container {
    border: none;
    box-shadow: none;
    background-color: transparent;
}

.theme-geocities .app-titlebar {
    display: none;
}

.theme-geocities .retro-separator {
    display: block;
    height: 6px;
    border: none;
    /* Classic rainbow separator */
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    margin: 24px 0;
}

.theme-geocities .btn {
    color: #000000;
    font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", sans-serif;
}

.theme-geocities .form-input {
    color: #000000;
    border: 3px inset var(--input-border);
}

.theme-geocities .file-drop {
    border: 3px dashed var(--file-drop-border);
}

.theme-geocities .button-bar {
    border: 3px ridge var(--border-color);
}

.theme-geocities .button-bar label {
    background-color: #c0c0c0;
    border-right: 3px ridge var(--border-color);
    color: #000000;
}

.theme-geocities .button-bar input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: #000000;
    border-top: 3px inset var(--border-color);
    border-left: 3px inset var(--border-color);
    border-right: 3px inset var(--border-color);
    border-bottom: none;
    box-shadow: none;
}

.theme-geocities .theme-switcher-container {
    border: 3px ridge #ff00ff;
}

/* Tasteful Marquee & Blink */
@keyframes geocities-marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes geocities-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.theme-geocities .header-flex > div:last-child {
    overflow: hidden;
    flex-grow: 1;
}

.theme-geocities .subtitle {
    display: inline-block;
    white-space: nowrap;
    animation: geocities-marquee 8s linear infinite;
    color: #00ffff;
    font-weight: bold;
    font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", sans-serif;
}

.theme-geocities .file-count {
    animation: geocities-blink 1s step-end infinite;
    color: #ff00ff;
    font-size: 1.1rem;
}