/* APPLESQUE MINIMALIST + FOLDER TABS */
:root {
    --bg-color: #F5F5F7;
    --card-bg: #FFFFFF;
    --tab-color: #007AFF;
    --text-main: #1D1D1F;
    --text-secondary: #86868B;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0; padding: 20px;
}

.app-container { max-width: 600px; margin: 0 auto; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
h1 { font-size: 28px; margin: 0; letter-spacing: -0.5px; }

/* CARD STYLES */
.recipe-card {
    background: var(--card-bg);
    margin-bottom: 18px;
    border-radius: 0 12px 12px 0; 
    box-shadow: 2px 2px 10px rgba(0,0,0,0.05);
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; position: relative;
    padding: 15px 15px 15px 25px;
    overflow: visible;
	content-visibility: auto;
	contain-intrinsic-size: 100px;
}
.recipe-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
    background-color: var(--tab-color);
    border-radius: 12px 0 0 12px;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.1);
}
.card-text { flex: 1; padding-right: 15px; }
.card-text h3 { margin: 0 0 5px 0; font-size: 18px; font-weight: 600; }
.card-text p {
    margin: 0; color: var(--text-secondary); font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* IMAGE THUMBNAIL ON CARD */
.card-image {
    width: 60px; height: 60px;
    background-color: #F2F2F7;
    border-radius: 12px; /* Slightly smoother corners */
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    
    /* Center the logo */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Style the SVG Logo specifically */
.default-logo svg {
    width: 40px; /* Made it slightly bigger so it fills the box nicely */
    height: 40px;
    opacity: 1.0;
    /* We removed the 'stroke' property here so the SVG controls its own colors */
}


/* MODAL STYLES */
/* We added #import-overlay to this list so it floats too! */
#modal-overlay, #reader-overlay, #import-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.4); 
    z-index: 100;
    display: flex; 
    justify-content: center; 
    align-items: center;
}

.modal-box {
    background: rgba(255,255,255,0.95); 
    backdrop-filter: blur(20px);
    padding: 25px; 
    border-radius: 20px; 
    width: 90%; 
    max-width: 500px;
    max-height: 90vh; 
    overflow-y: auto; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.5);
}

.hidden { display: none !important; }

/* FORMS */
.input-group { background: #F2F2F7; padding: 12px; border-radius: 10px; margin-bottom: 15px; }
.input-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; color: #555; }
input[type="text"], textarea {
    width: 100%; padding: 10px; border: 1px solid #ddd; background: #fff; border-radius: 8px;
    font-size: 16px; box-sizing: border-box; margin-bottom: 0;
}
textarea { height: 120px; resize: none; font-family: inherit; }
button {
    background: var(--tab-color); color: white; border: none; padding: 10px 20px;
    font-size: 15px; border-radius: 20px; font-weight: 600; cursor: pointer;
}
.button-group { display: flex; gap: 10px; margin-top: 15px; }

/* IMAGE PREVIEW BOX */
#preview-box { margin-top: 10px; text-align: center; }
#image-preview { max-width: 100%; max-height: 200px; border-radius: 8px; display: block; margin: 0 auto 10px auto; }
#remove-image-btn { background: #FF3B30; font-size: 12px; padding: 5px 10px; }

/* READER HERO IMAGE */
#reader-image {
    width: 100%;
    height: auto;           /* Let the height adjust naturally */
    max-height: 60vh;       /* Cap it at 60% of the screen height so it doesn't scroll forever */
    object-fit: contain;    /* Ensure we see the WHOLE image, no chopping */
    border-radius: 12px;
    margin-bottom: 20px;
    background-color: #f0f0f0; /* Slight background in case the image is transparent */
    display: block;
	
	/* HORIZONTAL FILTER BAR */
.filter-scroll {
    display: flex; gap: 10px; overflow-x: auto; 
    padding-bottom: 10px; margin-bottom: 20px;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.filter-scroll::-webkit-scrollbar { display: none; /* Hide scrollbar Chrome/Safari */ }

.filter-pill {
    background: #E5E5EA; color: #1D1D1F; 
    border: none; padding: 8px 16px; 
    border-radius: 20px; font-weight: 600; font-size: 14px;
    white-space: nowrap; cursor: pointer;
    transition: all 0.2s;
}

.filter-pill.active {
    background: #007AFF; color: white;
    box-shadow: 0 4px 10px rgba(0,122,255,0.3);
}

/* FOLDER COLORS (The little tab on the left of the card) */
.card-breakfast::before { background-color: #FF9500; } /* Orange */
.card-lunch::before     { background-color: #34C759; } /* Green */
.card-dinner::before    { background-color: #007AFF; } /* Blue */
.card-sides::before     { background-color: #FFCC00; } /* Yellow */
.card-dessert::before   { background-color: #AF52DE; } /* Purple */
.card-other::before     { background-color: #8E8E93; } /* Gray */

/* DROPDOWN STYLE */
select {
    width: 100%; padding: 12px; border: 1px solid #ddd; 
    background: #fff; border-radius: 8px; font-size: 16px; 
    margin-bottom: 15px; appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 15px top 50%; background-size: 12px;
}

/* STICKY HEADER MAGIC */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--bg-color); /* Matches background so list slides under it */
    margin: -20px -20px 20px -20px; /* Expands to cover the body padding */
    padding: 20px 20px 10px 20px; /* Adds the padding back inside */
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Tweak the existing header margin since we handle it in the sticky container now */
header { margin-bottom: 15px; }