/* ============================================
   Josie's Rezeptdatenbank — Soft & Feminine Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    /* Primary Palette — Warm Rose & Blush */
    --primary: #d4728c;
    --primary-light: #e8a0b4;
    --primary-dark: #b85a74;
    --primary-glow: rgba(212, 114, 140, 0.15);

    /* Secondary — Soft Lavender */
    --secondary: #b8a9d4;
    --secondary-light: #d5cce8;

    /* Accent — Warm Peach */
    --accent: #f2b6a0;
    --accent-warm: #e89b7b;

    /* Neutrals */
    --bg: #fdf6f0;
    --bg-warm: #fef9f5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --text: #4a3642;
    --text-light: #7d6574;
    --text-muted: #a89298;
    --white: #ffffff;
    --border: rgba(212, 114, 140, 0.15);
    --border-soft: rgba(212, 114, 140, 0.08);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 30%, #e8eaf6 60%, #fce4ec 100%);
    --gradient-primary: linear-gradient(135deg, #d4728c, #e8a0b4);
    --gradient-warm: linear-gradient(135deg, #f2b6a0, #d4728c);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(253,246,240,0.8));
    --gradient-header: linear-gradient(135deg, rgba(253,246,240,0.95), rgba(252,228,236,0.9));

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(212, 114, 140, 0.08);
    --shadow: 0 4px 20px rgba(212, 114, 140, 0.1);
    --shadow-lg: 0 8px 40px rgba(212, 114, 140, 0.15);
    --shadow-glow: 0 4px 25px rgba(212, 114, 140, 0.2);
    --shadow-card: 0 2px 16px rgba(212, 114, 140, 0.08), 0 1px 4px rgba(0,0,0,0.03);

    /* Shapes */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Phase Colors */
    --phase-menstruation: #e57373;
    --phase-menstruation-bg: #fce4ec;
    --phase-follikel: #81c784;
    --phase-follikel-bg: #e8f5e9;
    --phase-ovulation: #ffb74d;
    --phase-ovulation-bg: #fff3e0;
    --phase-luteal: #7986cb;
    --phase-luteal-bg: #e8eaf6;
}

/* ============================================
   Base & Reset
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(252, 228, 236, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(232, 234, 246, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(242, 182, 160, 0.1) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary-light);
    color: var(--white);
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: var(--text);
    margin-top: 0;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

h3 {
    font-size: 1.2rem;
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Layout
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px;
}

/* ============================================
   Header & Navigation
   ============================================ */

header {
    background: var(--gradient-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo a strong {
    font-weight: 600;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    color: var(--text-light);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s var(--ease);
    position: relative;
}

nav a:hover {
    color: var(--primary);
    background: var(--primary-glow);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: transform 0.3s var(--ease);
}

nav a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ============================================
   Dropdown Menu
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 8px;
    margin-top: 10px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s var(--ease);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.dropdown-menu a::after {
    display: none;
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        margin-top: 0;
        padding: 0;
        min-width: 0;
        text-align: center;
    }
    
    .dropdown-menu li {
        display: inline-block;
    }
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s var(--ease);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: var(--white);
}

.btn:hover::before {
    opacity: 1;
}

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

.btn-accent {
    background: var(--gradient-warm);
}

.btn-accent:hover {
    box-shadow: 0 4px 25px rgba(242, 182, 160, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

/* ============================================
   Cards — Glassmorphism
   ============================================ */

.card {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px;
    transition: all 0.4s var(--ease);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* ============================================
   Login Page
   ============================================ */

.login-container {
    max-width: 420px;
    margin: 80px auto;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeInUp 0.6s var(--ease);
}

.login-container h1 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 8px;
}

.login-container::before {
    content: '🌸';
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ============================================
   Forms
   ============================================ */

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 12px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-warm);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s var(--ease);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--white);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4728c' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 8px;
}

/* ============================================
   Alert / Error
   ============================================ */

.alert {
    padding: 14px 20px;
    background: linear-gradient(135deg, #fce4ec, #fff0f3);
    color: #c2185b;
    border: 1px solid rgba(194, 24, 91, 0.15);
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard-stats {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.dashboard-actions .card h3 {
    font-family: 'Quicksand', sans-serif;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.dashboard-actions .card p {
    color: var(--text-light);
    margin-bottom: 18px;
    line-height: 1.6;
}

/* ============================================
   Filter Form
   ============================================ */

.filter-form {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 36px;
}

/* ============================================
   Recipe Grid & Cards
   ============================================ */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.recipe-card {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.4s var(--ease);
    animation: fadeInUp 0.5s var(--ease) both;
}

.recipe-card:nth-child(1) { animation-delay: 0.05s; }
.recipe-card:nth-child(2) { animation-delay: 0.1s; }
.recipe-card:nth-child(3) { animation-delay: 0.15s; }
.recipe-card:nth-child(4) { animation-delay: 0.2s; }
.recipe-card:nth-child(5) { animation-delay: 0.25s; }
.recipe-card:nth-child(6) { animation-delay: 0.3s; }
.recipe-card:nth-child(7) { animation-delay: 0.35s; }
.recipe-card:nth-child(8) { animation-delay: 0.4s; }
.recipe-card:nth-child(9) { animation-delay: 0.45s; }

.recipe-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.recipe-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg);
    position: relative;
    overflow: hidden;
}

.recipe-content {
    padding: 20px 22px 22px;
}

.recipe-title {
    margin: 0 0 10px 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.recipe-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.recipe-title a:hover {
    color: var(--primary);
}

.recipe-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recipe-phases {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(212, 114, 140, 0.08);
    color: var(--text-light);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 4px;
    margin-bottom: 4px;
    transition: all 0.3s var(--ease);
}

.badge-phase {
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Phase-specific badge colors */
.badge-phase[data-phase="menstruation"] {
    background: var(--phase-menstruation-bg);
    color: var(--phase-menstruation);
}

.badge-phase[data-phase="follikelphase"] {
    background: var(--phase-follikel-bg);
    color: var(--phase-follikel);
}

.badge-phase[data-phase="ovulation"] {
    background: var(--phase-ovulation-bg);
    color: var(--phase-ovulation);
}

.badge-phase[data-phase="lutealphase"] {
    background: var(--phase-luteal-bg);
    color: var(--phase-luteal);
}

.badge-phase.active {
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary-light);
}

/* General phase badge styling — a soft rose */
.badge-phase {
    background: linear-gradient(135deg, rgba(212, 114, 140, 0.12), rgba(184, 169, 212, 0.1));
    color: var(--primary-dark);
}

/* ============================================
   Favorite Heart
   ============================================ */

.fav-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    text-decoration: none;
    transition: all 0.3s var(--ease-bounce);
    filter: drop-shadow(0 2px 4px rgba(212, 114, 140, 0.15));
    line-height: 1;
}

.fav-heart svg {
    display: block;
}

.fav-heart:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 12px rgba(212, 114, 140, 0.3));
}

/* ============================================
   Recipe Detail View
   ============================================ */

.recipe-view {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s var(--ease);
}

.recipe-hero {
    position: relative;
    overflow: hidden;
}

.recipe-detail-content {
    padding: 40px;
}

.recipe-description {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 30px;
}

.recipe-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(253,246,240,0.8), rgba(252,228,236,0.3));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
}

.recipe-info-grid strong {
    font-family: 'Quicksand', sans-serif;
    color: var(--primary-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ingredients-section {
    background: linear-gradient(135deg, rgba(253,246,240,0.6), rgba(255,255,255,0.8));
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

.ingredients-section ul {
    list-style: none;
    padding: 0;
}

.ingredients-section li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.2s var(--ease);
}

.ingredients-section li:hover {
    background: rgba(212, 114, 140, 0.03);
    padding-left: 8px;
}

.ingredients-section li:last-child {
    border-bottom: none;
}

.preparation-section {
    line-height: 1.9;
    color: var(--text);
}

.preparation-section h3 {
    color: var(--primary-dark);
    margin-bottom: 16px;
}

/* ============================================
   Recipe Form
   ============================================ */

.recipe-form {
    animation: fadeInUp 0.5s var(--ease);
}

.recipe-form .side-fields {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 2fr 40px;
    gap: 10px;
    margin-bottom: 10px;
    animation: fadeInUp 0.3s var(--ease);
}

.ingredient-row .remove-ing {
    padding: 5px;
    border-radius: var(--radius);
    font-size: 1.1rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.85rem;
    margin-top: 60px;
    border-top: 1px solid var(--border-soft);
}

.footer p::before {
    content: '🌷 ';
}

.footer p::after {
    content: ' 🌷';
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: var(--radius-full);
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 1.6rem;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .container {
        padding: 20px 16px;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .recipe-form > div {
        display: block !important;
    }

    .main-fields, .side-fields {
        width: 100%;
    }

    .recipe-form .side-fields {
        position: static;
        margin-top: 24px;
    }

    .recipe-view > div:last-child {
        grid-template-columns: 1fr !important;
    }

    .recipe-detail-content {
        padding: 24px 20px;
    }

    .dashboard-actions {
        grid-template-columns: 1fr !important;
    }

    .ingredient-row {
        grid-template-columns: 1fr 1fr !important;
    }

    .ingredient-row input:nth-child(3),
    .ingredient-row input:nth-child(4) {
        grid-column: span 2;
    }

    .login-container {
        margin: 40px 16px;
        padding: 36px 24px;
    }

    .filter-form > div {
        grid-template-columns: 1fr !important;
    }
}

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

    .recipe-image {
        height: 180px;
    }

    h1 {
        font-size: 1.4rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
