/* FOOOD - VHS / Stranger Things Style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f5f0;
    --text: #404040;
    --text-bright: #1a1a1a;
    --text-dim: #808080;
    --accent: #606060;
    --border: #c0c0c0;
    --glow: rgba(0, 0, 0, 0.08);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
    -webkit-font-smoothing: auto;
}

/* CRT Container */
.crt {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Disabled effects */
.scanlines,
.noise {
    display: none;
}

/* Screens */
.screen {
    position: relative;
    z-index: 1;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    max-width: 900px;
    margin: 0 auto;
}

/* PASSWORD SCREEN */
.password-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.ascii-logo {
    color: var(--text-bright);
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    white-space: pre;
}

.password-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.password-form label {
    color: var(--text);
    letter-spacing: 2px;
}

.password-form input {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-bright);
    font-family: inherit;
    font-size: 16px;
    padding: 10px 15px;
    width: 200px;
    text-align: center;
    letter-spacing: 4px;
}

.password-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.password-form button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 30px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}

.password-form button:hover {
    background: var(--text-bright);
    color: var(--bg);
}

/* MAIN SCREEN */
.main-screen {
    display: flex;
    flex-direction: column;
    padding-bottom: 70px;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.ascii-title {
    color: var(--text-bright);
    font-size: 11px;
    line-height: 1.2;
    white-space: pre;
    display: inline-block;
}

.main-title {
    color: var(--text-bright);
    font-size: 26px;
    letter-spacing: 4px;
    text-align: center;
}

.logout-btn {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    padding: 5px;
}

.logout-btn:hover {
    color: var(--text-bright);
}

/* Input Section */
.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.input-section input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-bright);
    font-family: inherit;
    font-size: 14px;
    padding: 12px;
}

.input-section input:focus {
    outline: none;
    border-color: var(--accent);
}

.input-section input::placeholder {
    color: var(--text-dim);
}

.hint {
    display: block;
    color: var(--text);
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

/* Big Button */
.big-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: 2px solid var(--text);
    color: var(--text-bright);
    font-family: inherit;
    font-size: 18px;
    padding: 20px;
    cursor: pointer;
    letter-spacing: 4px;
    margin-bottom: 25px;
    transition: all 0.2s;
}

.big-btn:hover:not(:disabled) {
    background: var(--text-bright);
    color: #f5f5f0;
}

.big-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.big-btn .btn-loading {
    display: none;
}

.big-btn.loading .btn-text {
    display: none;
}

.big-btn.loading .btn-loading {
    display: inline;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Results */
.results {
    flex: 1;
    min-height: 200px;
}

.results-placeholder {
    color: var(--text-dim);
    text-align: center;
    padding: 20px 0;
}

.results-placeholder pre {
    font-size: 12px;
    line-height: 1.3;
    white-space: pre;
}

/* Idea Card */
.idea-card {
    border: 1px solid var(--border);
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
}

.idea-card .idea-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.idea-card .idea-title {
    color: var(--text-bright);
    font-size: 14px;
    margin-bottom: 5px;
}

.idea-card .idea-title::before {
    content: '> ';
    color: var(--accent);
}

.idea-card .idea-desc {
    color: var(--text);
    font-size: 13px;
    padding-left: 14px;
}

.idea-card .fav-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.idea-card .fav-btn:hover {
    color: var(--text-bright);
}

.idea-card .fav-btn.saved {
    color: var(--text-bright);
}

.idea-card .idea-content {
    cursor: pointer;
    flex: 1;
}

.idea-card .idea-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-left: 14px;
}

.idea-card .idea-rating {
    color: var(--text);
    font-size: 11px;
    letter-spacing: 1px;
}

.idea-card .idea-hint {
    color: var(--text);
    font-size: 11px;
    opacity: 0.7;
}

/* Recipe expansion */
.idea-recipe {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
}

.idea-recipe.hidden {
    display: none;
}

.recipe-loading {
    color: var(--text-dim);
    font-family: monospace;
    letter-spacing: 2px;
}

.recipe-error {
    color: #a05050;
}

.recipe-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-bright);
    margin: 0;
}

.recipe-link {
    display: block;
    margin-top: 15px;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
}

.recipe-link:hover {
    color: var(--text-bright);
}

/* Typing animation */
.idea-card.typing .idea-title,
.idea-card.typing .idea-desc {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 0.5s steps(30) forwards;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    display: flex;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 100;
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    padding: 18px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}

.nav-btn:first-child {
    border-right: 1px solid var(--border);
}

.nav-btn.active {
    color: var(--text-bright);
    background: rgba(0, 0, 0, 0.05);
}

.nav-btn:hover:not(.active) {
    color: var(--text);
}

/* Favorites View */
.favorites-view {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    bottom: 60px;
    background: var(--bg);
    padding: 20px;
    overflow-y: auto;
    z-index: 50;
}

.favorites-view.hidden {
    display: none;
}

.favorites-view h2 {
    text-align: center;
    color: var(--text-bright);
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.favorites-list .empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 40px 0;
}

/* Favorite Item */
.favorite-item {
    border: 1px solid var(--border);
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
}

.favorite-item .fav-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.favorite-item .fav-title {
    color: var(--text-bright);
    font-size: 14px;
    margin-bottom: 5px;
}

.favorite-item .fav-title::before {
    content: '> ';
    color: var(--accent);
}

.favorite-item .fav-desc {
    color: var(--text);
    font-size: 13px;
    padding-left: 14px;
}

.favorite-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.favorite-item .remove-btn:hover {
    color: var(--text-bright);
}

/* Error message */
.error-msg {
    color: #a05050;
    text-align: center;
    padding: 20px;
    border: 1px solid #503030;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Mobile adjustments */
@media (max-width: 400px) {
    .ascii-logo {
        font-size: 8px;
    }

    .ascii-title {
        font-size: 9px;
    }

    body {
        font-size: 13px;
    }
}
