/* ==================== VARIABLES & GLOBAL ==================== */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --dark-bg: #1a1a2e;
    --light-bg: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --border-color: #e0e0e0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

/* ==================== BUTTONS ==================== */
.btn-nav {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-nav:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-large {
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
    width: 100%;
}

.btn-back {
    background: linear-gradient(135deg, var(--secondary-color), #2ba39b);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.btn-back:hover {
    background: linear-gradient(135deg, #2ba39b, #1f8f87);
    transform: translateX(-5px);
    box-shadow: 0 6px 15px rgba(78, 205, 196, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: #3dbab0;
    transform: scale(1.05);
}

.btn-danger {
    background-color: #ff4757;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-danger:hover {
    background-color: #ff3838;
    transform: scale(1.05);
}

/* ==================== CONTAINER & VIEWS ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 100px);
}

.view {
    animation: fadeIn 0.5s ease-in;
    display: none;
}

.view.active {
    display: block;
}

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

/* ==================== DASHBOARD ==================== */
.dashboard-header {
    margin-bottom: 3rem;
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dashboard-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--secondary-color), #2ba39b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: #666;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.recipe-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.12);
    cursor: pointer;
    transition: var(--transition);
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(78, 205, 196, 0.1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.recipe-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(78, 205, 196, 0.25);
}

.recipe-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.recipe-card:hover .recipe-card-image {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.recipe-card-content {
    padding: 1.5rem;
}

.recipe-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 1rem;
}

.recipe-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.recipe-card-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.recipe-card-footer {
    display: flex;
    gap: 0.5rem;
}

.recipe-card-footer button {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-view {
    background: linear-gradient(135deg, var(--secondary-color), #2ba39b);
    color: white;
}

.btn-view:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(78, 205, 196, 0.3);
}

.btn-delete {
    background: #ffe0e0;
    color: var(--primary-color);
}

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

/* ==================== RECIPE DETAIL ==================== */
.recipe-detail {
    background: #fafafa;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.12);
    animation: expandDown 0.5s ease-out;
    overflow: hidden;
}

@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 100%;
    }
}

.recipe-detail-banner {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--secondary-color), #2ba39b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.2);
}

.recipe-detail-content {
    padding: 2.5rem;
    background: #fafafa;
}

.recipe-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.recipe-detail-title {
    flex: 1;
}

.recipe-detail-title h1 {
    font-size: 2.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recipe-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.08), rgba(78, 205, 196, 0.12));
    border-radius: 12px;
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.meta-item {
    padding: 0.5rem 0;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

.recipe-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 2.5rem;
    padding: 1.3rem;
    background: white;
    border-left: 5px solid var(--secondary-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.1);
}

.recipe-section {
    margin-bottom: 2.5rem;
}

.recipe-section h2 {
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--secondary-color);
    display: inline-block;
    font-weight: 700;
}

.ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.ingredient-item {
    padding: 0.95rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(78, 205, 196, 0.08);
}

.ingredient-item:hover {
    transform: translateX(5px);
    background: #f0fffe;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.15);
}

.ingredient-item input[type="checkbox"] {
    cursor: pointer;
    margin-right: 0.7rem;
    accent-color: var(--secondary-color);
}

.ingredient-item label {
    cursor: pointer;
    user-select: none;
    color: #555;
    font-size: 0.95rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-item {
    display: flex;
    gap: 1.3rem;
    padding: 1.2rem;
    background: white;
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid rgba(78, 205, 196, 0.15);
    box-shadow: 0 2px 6px rgba(78, 205, 196, 0.08);
}

.step-item:hover {
    background: #f0fffe;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.15);
}

.step-number {
    min-width: 42px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--secondary-color), #2ba39b);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.step-content {
    flex: 1;
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(78, 205, 196, 0.2);
    flex-wrap: wrap;
}

.btn-print-pdf {
    flex: 1;
    background: linear-gradient(135deg, var(--secondary-color), #2ba39b);
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-print-pdf:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.4);
}

/* ==================== FORM STYLES ==================== */
.form-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 3rem;
    max-width: 700px;
    margin: 0 auto;
    animation: slideUp 0.5s ease-out;
}

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

.form-container h1 {
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

small {
    display: block;
    margin-top: 0.3rem;
    color: #999;
    font-size: 0.85rem;
}

input[type="text"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.empty-state p {
    color: #999;
    margin-bottom: 2rem;
}

/* ==================== MEDIA QUERIES ==================== */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-buttons {
        width: 100%;
        flex-direction: column;
    }

    .btn-nav {
        width: 100%;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .recipe-detail-header {
        flex-direction: column;
    }

    .recipe-detail-content {
        padding: 1.5rem;
    }

    .recipe-detail-title h1 {
        font-size: 1.6rem;
    }

    .dashboard-header h1 {
        font-size: 1.8rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 1.5rem;
    }

    .recipe-detail-banner {
        height: 220px;
        font-size: 3.5rem;
    }

    .detail-actions {
        flex-direction: column;
    }

    .btn-print-pdf {
        flex: 1;
    }

    .recipe-section h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .recipe-detail-meta {
        grid-template-columns: 1fr;
    }

    .recipe-meta-item {
        font-size: 0.85rem;
    }

    .recipe-card-title {
        font-size: 1.1rem;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .navbar,
    .btn-back,
    .detail-actions {
        display: none;
    }

    body {
        background: white;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .recipe-detail {
        box-shadow: none;
        border-radius: 0;
    }
}
