/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8f9fa;
    color: #1a1a1a;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    flex-shrink: 0;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.mobile-toggle:hover {
    background-color: #f8f9fa;
}

.mobile-toggle svg {
    width: 20px;
    height: 20px;
}

.search-filter-container {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

.search-container {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
}



.autocomplete-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8f9fa;
}

.autocomplete-item-text {
    flex: 1;
}

.autocomplete-item-title {
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.autocomplete-item-author {
    font-size: 12px;
    color: #6c757d;
}

.autocomplete-item-category {
    font-size: 10px;
    color: #007bff;
    background: #e7f3ff;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.autocomplete-item.browse-all {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.autocomplete-item.browse-all .autocomplete-item-title {
    color: #007bff;
    font-weight: 600;
}

.filter-container {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.15);
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.filter-select option {
    padding: 8px 12px;
    font-weight: 500;
}

.filter-select option:first-child {
    font-weight: 600;
    color: #6c757d;
}

/* Main content */
.main {
    padding: 40px 0;
}

/* Hero section */
.hero-section {
    margin-bottom: 60px;
}

.hero-recipe {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-recipe:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px;
}

.hero-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-author {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 16px;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.hero-category {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Recipe grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.recipe-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.recipe-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.recipe-content {
    padding: 20px;
}

.recipe-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.recipe-author {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 12px;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
}

.recipe-category {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.recipe-time {
    font-weight: 500;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 40px 0;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-btn:hover {
    background: #0056b3;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: #e9ecef;
}

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

#pdfContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

#pdfViewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .search-filter-container {
        display: none;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .search-filter-container.show {
        display: flex;
    }
    
    .filter-container {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-select {
        min-width: 120px;
        font-size: 13px;
        padding: 10px 12px;
        padding-right: 36px;
    }
    
    .hero-recipe {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .hero-content {
        padding: 24px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 16px 0;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .search-filter-container {
        gap: 12px;
    }
    
    .search-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .filter-select {
        min-width: 100px;
        font-size: 12px;
        padding: 8px 10px;
        padding-right: 32px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .recipe-content {
        padding: 16px;
    }
    
    .recipe-title {
        font-size: 16px;
    }
} 