/* Win98 Recipe Lab Notebook Styles */

/* === Base === */
* {
    box-sizing: border-box;
}

body {
    --desktop-bg: #547E7E;
    background-color: var(--desktop-bg);
    font-family: "Georgia", serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

/* === Window Chrome === */
.window {
    background: #C0C0C0;
    border: 2px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    box-shadow: 2px 2px 0px #000;
    max-width: 800px;
    margin: 0 auto;
}

.title-bar {
    background: linear-gradient(to right, #000080, #1084D0);
    color: white;
    padding: 3px 5px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-btn {
    width: 16px;
    height: 14px;
    background: #C0C0C0;
    border: 1px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    font-size: 10px;
    line-height: 12px;
    text-align: center;
    cursor: pointer;
}

.window-btn:active {
    border-color: #808080 #FFFFFF #FFFFFF #808080;
}

/* === Menu Bar === */
.menu-bar {
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    padding: 4px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
}

.menu-item {
    display: inline-block;
    padding: 4px 8px;
    cursor: pointer;
    position: relative;
}

.menu-item:hover {
    background: #316AC5;
    color: white;
}

/* === Dropdown Menu === */
.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #C0C0C0;
    border: 1px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    box-shadow: 2px 2px 0px #000;
    min-width: 140px;
    z-index: 100;
    padding: 2px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
}

.menu-item:hover .menu-dropdown,
.menu-item.menu-open .menu-dropdown {
    display: block;
}

.menu-dropdown-item {
    display: block;
    padding: 4px 20px 4px 8px;
    cursor: default;
    white-space: nowrap;
    color: #000;
}

.menu-dropdown-item:hover {
    background: #000080;
    color: white;
}

.menu-dropdown-separator {
    height: 1px;
    background: #808080;
    margin: 2px 0;
    border-bottom: 1px solid #FFFFFF;
}

.menu-dropdown-item .checkmark {
    display: inline-block;
    width: 16px;
    margin-left: -4px;
}

/* === Content Area === */
.content {
    background: white;
    padding: 20px;
    min-height: 500px;
    position: relative;
}

/* === Recipe Header === */
.recipe-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #C0C0C0;
}

.recipe-title {
    font-family: "Trebuchet MS", "Tahoma", sans-serif;
    font-size: 20px;
    color: #000080;
    letter-spacing: 0.04em;
}

.recipe-subtitle {
    font-family: "Georgia", serif;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

.recipe-meta span::before {
    content: "■ ";
    color: #800020;
    font-size: 8px;
    vertical-align: middle;
}

/* === Canonical Badge === */
.canonical-badge {
    display: inline-block;
    background: #C0C0C0;
    color: #000080;
    padding: 2px 8px;
    font-family: "Tahoma", "MS Sans Serif", sans-serif;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    margin-left: 10px;
}

/* === Recipe Image === */
.recipe-image {
    float: right;
    width: 200px;
    height: 150px;
    background: #F0F0F0;
    border: 2px inset #808080;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #808080;
    margin: 0 0 15px 15px;
}

/* === Tabs === */
.info-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0 0 0;
    flex-wrap: wrap;
}

.tab {
    background: #C0C0C0;
    border: 1px solid #808080;
    border-bottom: none;
    padding: 5px 15px;
    cursor: pointer;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    position: relative;
    top: 1px;
}

.tab:hover {
    background: #D4D0C8;
}

.tab.active {
    background: white;
    z-index: 1;
    border-bottom: 1px solid white;
}

.tab-content {
    display: none;
    border: 1px solid #808080;
    border-top: none;
    padding: 15px;
    background: white;
}

.tab-content.active {
    display: block;
}

/* === Sections === */
.section {
    background: #FFFEF7;
    border: 1px inset #808080;
    padding: 15px;
    margin: 15px 0;
}

.section-title {
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #800020;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* === Win98 Horizontal Rule === */
hr.win-hr {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #FFFFFF;
    margin: 12px 0;
}

/* === Ingredients === */
.ingredient {
    font-family: "Georgia", serif;
    line-height: 1.8;
    padding-left: 20px;
    position: relative;
}

.ingredient:before {
    content: "\25B8";
    position: absolute;
    left: 0;
    color: #800020;
}

.ingredient-quantity {
    font-weight: bold;
    color: #000080;
}

.ingredient-note {
    font-style: italic;
    color: #666;
    font-size: 14px;
}

.note {
    font-style: italic;
    color: #666;
    font-size: 14px;
}

/* === Scaling Controls === */
.scaling-controls {
    background: #C0C0C0;
    border: 1px solid #808080;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
}

.scaling-label {
    font-weight: bold;
}

.multiplier-buttons {
    display: flex;
    gap: 3px;
}

.multiplier-btn {
    background: #C0C0C0;
    border: 1px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    padding: 2px 8px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 10px;
    cursor: pointer;
}

.multiplier-btn:active,
.multiplier-btn.active {
    border-color: #808080 #FFFFFF #FFFFFF #808080;
    background: #B0B0B0;
}

.spin-button-container {
    display: flex;
    align-items: center;
    gap: 0;
}

.spin-input {
    width: 50px;
    height: 22px;
    border: 1px inset #808080;
    text-align: center;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 12px;
    background: white;
}

.spin-buttons {
    display: flex;
    flex-direction: column;
}

.spin-btn {
    width: 16px;
    height: 11px;
    background: #C0C0C0;
    border: 1px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    font-size: 8px;
    line-height: 8px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spin-btn:active {
    border-color: #808080 #FFFFFF #FFFFFF #808080;
}

.scaling-info {
    color: #666;
    font-style: italic;
}

/* === Directions === */
.direction {
    margin: 15px 0;
    line-height: 1.6;
}

.direction-number {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #800020;
    color: white;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    margin-right: 10px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
}

.direction-title {
    font-weight: bold;
    color: #000080;
}

/* === Notes & Deviations === */
.note-item {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.note-item:before {
    content: "\25B8";
    position: absolute;
    left: 0;
    color: #800020;
}

.deviation-item {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.deviation-item:before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: #800020;
}

/* === Lab Log === */
.log-entry {
    margin: 15px 0;
    padding: 10px;
    background: #FFFFF8;
    border-left: 3px solid #800020;
}

.log-date {
    font-family: "Courier New", monospace;
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.log-text {
    font-family: "Georgia", serif;
    line-height: 1.6;
}

.empty-log {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

/* === Tags === */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    display: inline-block;
    background: #E0E0E0;
    border: 1px solid #808080;
    padding: 2px 8px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 10px;
    color: #333;
}

/* === Recipe Cards (Index Page) === */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
}

.recipe-card {
    background: white;
    border: 1px solid #808080;
    padding: 15px;
    text-align: center;
    cursor: pointer;
}

.recipe-card:hover {
    background: #F0F0F0;
}

.recipe-card:active {
    border-color: #808080 #FFFFFF #FFFFFF #808080;
}

.recipe-card.canonical {
    border-left: 3px solid #800020;
}

.recipe-card-title {
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.recipe-card-desc {
    font-size: 11px;
    color: #444;
    margin-top: 3px;
    line-height: 1.3;
}

.recipe-card .tags {
    justify-content: center;
    margin-top: 8px;
}

/* === Status Bar === */
.status-bar {
    background: #C0C0C0;
    border-top: 1px solid #FFFFFF;
    padding: 4px 8px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    color: #333;
    display: flex;
    justify-content: space-between;
}

.status-bar-section {
    border: 1px inset #808080;
    padding: 2px 8px;
    background: #F0F0F0;
}

/* === Error Dialog === */
.error-dialog {
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-message {
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 12px;
    margin-bottom: 20px;
}

.error-btn {
    background: #C0C0C0;
    border: 2px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    padding: 5px 30px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    cursor: pointer;
}

.error-btn:active {
    border-color: #808080 #FFFFFF #FFFFFF #808080;
}

/* === Toolbar === */
.toolbar {
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    padding: 4px;
    display: flex;
    gap: 5px;
}

.toolbar-btn {
    background: #C0C0C0;
    border: 1px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
    padding: 3px 8px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn:hover {
    background: #D4D0C8;
}

.toolbar-btn:active,
.toolbar-btn.active {
    border-color: #808080 #FFFFFF #FFFFFF #808080;
    background: #B0B0B0;
}

/* === Mobile Responsive === */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .window {
        margin: 0;
    }

    .content {
        padding: 10px;
    }

    .recipe-header {
        text-align: center;
    }

    .recipe-title {
        font-size: 18px;
    }

    .recipe-image {
        float: none;
        margin: 10px auto;
    }

    .info-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .tab {
        min-width: 80px;
        flex-shrink: 0;
    }

    .scaling-controls {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
}

@media (max-width: 400px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}

/* === Print Styles === */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .window {
        max-width: none;
        box-shadow: none;
        border: none;
    }

    .title-bar,
    .menu-bar,
    .toolbar,
    .status-bar,
    .info-tabs,
    .scaling-controls {
        display: none !important;
    }

    .tab-content {
        display: block !important;
        border: none;
        padding: 10px 0;
        margin-top: 20px;
    }

    .tab-content::before {
        display: block;
        font-family: "MS Sans Serif", Tahoma, sans-serif;
        font-size: 14px;
        font-weight: bold;
        color: #000080;
        border-bottom: 2px solid #800020;
        padding-bottom: 5px;
        margin-bottom: 15px;
    }

    #overview-content::before { content: "Overview"; }
    #recipe-content::before { content: "Recipe"; }
    #notes-content::before { content: "Notes"; }

    .content {
        padding: 0;
    }

    .section {
        break-inside: avoid;
    }
}
