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

:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --dark: #2C3E50;
    --light: #ECF0F1;
    --success: #2ECC71;
    --danger: #E74C3C;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url("images/background.jpg") center/cover fixed no-repeat;
    min-height: 100vh;
    transition: all 0.3s ease;
}

body.dark {
    background: url("images/background.jpg") center/cover fixed no-repeat;
}

body.font-small { font-size: 14px; }
body.font-medium { font-size: 16px; }
body.font-large { font-size: 18px; }

.recipe-list-bg {
    min-height: 100vh;
}

body.dark .recipe-list-bg {
    background: none;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Login Screen */
.login-hero {
    min-height: 100vh;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,107,107,0.9), rgba(78,205,196,0.9));
}

.login-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

body.dark .login-box {
    background: #1e1e1e;
    color: #fff;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 4em;
    display: block;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    color: var(--primary);
    font-size: 2em;
    margin-bottom: 10px;
}

body.dark .logo h1 {
    color: var(--accent);
}

.tagline {
    color: #7f8c8d;
    font-size: 0.95em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

body.dark .form-group label {
    color: #fff;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s;
    background: #f8f9fa;
}

body.dark input[type="text"],
body.dark input[type="password"],
body.dark input[type="number"],
body.dark textarea,
body.dark select {
    background: #2a2a2a;
    color: #fff;
    border-color: #444;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(255,107,107,0.1);
}

body.dark input:focus,
body.dark textarea:focus,
body.dark select:focus {
    background: #333;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #ff8787);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.error {
    color: var(--danger);
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
}

.demo-users {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

body.dark .demo-users {
    background: #2a2a2a;
}

.demo-users p {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark);
}

body.dark .demo-users p {
    color: #fff;
}

.demo-users small {
    color: #7f8c8d;
    font-size: 0.85em;
}

.btn-reset {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset:hover {
    background: var(--danger);
    color: white;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.dark .header {
    background: #1e1e1e;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left .logo-icon {
    font-size: 2em;
    animation: none;
}

.header h1 {
    color: var(--primary);
    font-size: 1.8em;
}

body.dark .header h1 {
    color: var(--accent);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 50px;
    height: 50px;
    border: none;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
}

body.dark .btn-icon {
    background: #2a2a2a;
}

.btn-icon:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-back {
    padding: 12px 24px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(78,205,196,0.3);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

.search-bar input {
    width: 100%;
    padding-right: 50px;
}

.btn-add {
    padding: 14px 30px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46,204,113,0.3);
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.recipe-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

body.dark .recipe-card {
    background: #2a2a2a;
}

.recipe-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.recipe-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.recipe-info {
    padding: 25px;
}

.recipe-info h3 {
    color: var(--primary);
    font-size: 1.4em;
    margin-bottom: 15px;
}

body.dark .recipe-info h3 {
    color: var(--accent);
}

.recipe-info p {
    color: #7f8c8d;
    margin: 5px 0;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.setting-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

body.dark .setting-card {
    background: #2a2a2a;
}

.setting-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.setting-card label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--dark);
}

body.dark .setting-card label {
    color: #fff;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-container input[type="range"] {
    flex: 1;
}

.range-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2em;
    min-width: 40px;
}

.btn-save {
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

/* Recipe Display */
.recipe-hero-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    display: none;
}

.recipe-content-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.recipe-section {
    background: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

body.dark .recipe-section {
    background: #2a2a2a;
}

.recipe-section h2 {
    color: var(--primary);
    font-size: 1.6em;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.dark .recipe-section h2 {
    color: var(--accent);
}

.ingredients-list,
.instructions-list {
    line-height: 2;
    color: var(--dark);
}

body.dark .ingredients-list,
body.dark .instructions-list {
    color: #e0e0e0;
}

.ingredients-list li,
.instructions-list li {
    margin-bottom: 12px;
    padding-right: 10px;
}

.instructions-list li {
    padding-right: 15px;
}

/* Controls */
.controls-section {
    background: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

body.dark .controls-section {
    background: #2a2a2a;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-control {
    flex: 1;
    min-width: 180px;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.btn-play {
    background: linear-gradient(135deg, var(--success), #27ae60);
}

.btn-restart {
    background: linear-gradient(135deg, var(--secondary), #45b7af);
}

.btn-stop {
    background: linear-gradient(135deg, var(--danger), #c0392b);
}

.btn-control:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.current-line {
    background: linear-gradient(135deg, #fff3cd, #ffe8a1);
    padding: 25px;
    border-radius: 15px;
    border-right: 5px solid var(--accent);
    font-weight: 600;
    font-size: 1.1em;
    min-height: 70px;
    display: flex;
    align-items: center;
    color: var(--dark);
}

body.dark .current-line {
    background: linear-gradient(135deg, #3a3a1e, #4a4a2e);
    color: #fff;
}

/* Form Card */
.form-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

body.dark .form-card {
    background: #2a2a2a;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn-control {
        min-width: 100%;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-bar {
        min-width: 100%;
    }
    
    .login-box {
        padding: 35px 25px;
    }
}
