:root {
    --bg-gradient: linear-gradient(135deg, #fafafa 0%, #f0f2f5 100%);
    --primary: #11998e;
    --primary-light: #38ef7d;
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    --radius: 20px;
    /* Ko-fi Colors */
    --kofi-blue: #29abe0;
    --kofi-orange: #ff5e5b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    direction: rtl;
    display: flex;
    flex-direction: column;
}

body.modal-open {
    overflow: hidden;
}

/* Layout */
.app-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.header-bottom {
    display: flex;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: var(--primary);
}

.header-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    direction: ltr;
}

.header-right-side {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.header-bsd {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: bold;
}

/* Hero Section */
.hero {
    padding: 80px 5%;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero .subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

/* Search Area */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.search-wrapper {
    position: relative;
    margin-bottom: 30px;
}

#searchInput {
    width: 100%;
    padding: 25px 35px;
    font-size: 1.8rem;
    border: none;
    border-radius: 24px;
    background: white;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    outline: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#searchInput:focus {
    transform: scale(1.02);
    box-shadow: 0 20px 45px rgba(0,0,0,0.12);
}



.clear-search-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    display: none;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.clear-search-btn:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.category-btn {
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.category-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

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

/* Results Area */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 5%;
    width: 100%;
}

.results-summary {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 600;
}

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

.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.2);
}

.result-item {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

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

.result-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.result-item.non-kosher {
    border-color: #ff4d4f;
    background: #fff1f0;
}

.result-item.non-kosher .result-title {
    color: #ff4d4f;
}

.result-item.non-kosher .blessing-name {
    color: #ff4d4f;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.result-category {
    font-size: 0.85rem;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 600;
}

.blessing-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.blessing-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.blessing-name {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.blessing-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.full-view-btn-container {
    margin-top: 15px;
    text-align: center;
}

.full-view-btn-styled {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.full-view-btn-styled:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.notes-box {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* About/Policy Section on Home */
.content-deepening {
    background: white;
    padding: 80px 5%;
    margin-top: 60px;
    border-top: 1px solid #eee;
}

.content-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.content-grid h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.content-grid p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Footer */
footer {
    background: #1d1d1f;
    color: white;
    padding: 60px 5%;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-links a {
    color: #a1a1a6;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    color: #86868b;
    font-size: 0.9rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-icons a,
.social-icons a:visited {
    color: #a1a1a6;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: color 0.2s ease, background 0.2s ease;
}

.social-icons a:hover,
.social-icons a:active,
.social-icons a:focus {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.social-icons svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Donation Card Component */
.donation-section {
    padding: 60px 5%;
    display: flex;
    justify-content: center;
    background: transparent;
}

.donation-card {
    background: white;
    padding: 40px 30px;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(41, 171, 224, 0.1);
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(41, 171, 224, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.donation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(41, 171, 224, 0.15);
}

.donation-card h2 {
    margin: 0 0 15px 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.donation-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.card-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kofi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 1.1rem;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--kofi-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #2497c6;
    transform: scale(1.02);
}

.btn-secondary {
    background-color: transparent;
    color: var(--kofi-blue);
    border: 2px solid var(--kofi-blue);
}

.btn-secondary:hover {
    background-color: rgba(41, 171, 224, 0.05);
    transform: scale(1.02);
}

/* Footer CTA */
.footer-cta {
    background-color: transparent !important;
    color: var(--kofi-blue) !important;
    padding: 0 !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    box-shadow: none !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
    border: none !important;
    outline: none !important;
    text-decoration: none;
}

.footer-cta:hover {
    transform: translateY(-2px) scale(1.05);
    background-color: transparent !important;
    color: #2497c6 !important;
}

/* Donation Modal Specifics */
.donation-modal-content {
    max-width: 450px;
    text-align: center;
    padding: 40px 30px;
}

.donation-modal-content h2 {
    margin-top: 0;
    font-size: 2rem;
    font-weight: 800;
}

.donation-modal-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .donation-card {
        padding: 30px 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    #searchInput {
        font-size: 1.4rem;
        padding: 20px 35px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}



/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 50px;
    border-radius: 32px;
    max-width: 800px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: modalIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-modal {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

#modalBody .result-title {
    font-size: 3rem;
    margin-bottom: 30px;
    text-align: center;
}

#modalBody .blessing-box {
    padding: 25px;
    border-radius: 20px;
}

#modalBody .blessing-name {
    font-size: 1.8rem;
}

#modalBody .blessing-text {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px;
    }
    
    #modalBody .result-title {
        font-size: 2rem;
    }
}

/* Shout Animation for Non-Kosher Results */
.shout-animation {
    text-align: center;
    color: #ff4d4f;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    background: #fff1f0;
    padding: 60px 40px;
    border-radius: 32px;
    border: 2px dashed #ff4d4f;
    grid-column: 1 / -1;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shout-animation h3 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    margin-top: 0;
    color: #ff4d4f;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.shout-animation h3 span {
    font-size: 4.5rem;
    color: #ff4d4f;
}

.shout-animation p {
    font-size: 1.8rem;
    color: #515154;
    margin: 0;
    line-height: 1.5;
    max-width: 800px;
}

.shout-animation strong {
    color: #1d1d1f;
}

/* Modal Non-Kosher Warning */
.non-kosher-modal {
    background: #fff1f0 !important;
    border: 2px dashed #ff4d4f !important;
    box-shadow: none !important;
}

.non-kosher-modal .result-title {
    color: #ff4d4f !important;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Install App Button */
.install-btn {
    background: transparent;
    color: #a1a1a6;
    border: none;
    padding: 0;
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    display: none; 
    transition: color 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.install-btn:hover {
    color: var(--primary);
}

/* Bug Report Modal Specifics */
.bug-modal .modal-content {
    max-width: 640px; /* Responsive desktop width */
    padding: 40px 20px 20px;
}

@media (max-width: 768px) {
    .bug-modal .modal-content {
        width: 90%; /* Responsive mobile width */
        padding: 40px 10px 10px;
    }
}

.bug-modal .modal-body {
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: 12px;
}

.report-bug-link {
    font-weight: 500;
    color: var(--primary) !important; /* Make it stand out slightly while looking like a link */
}

.report-bug-link:hover {
    text-decoration: underline;
}
/* Toast Notification */
.ai-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    max-width: 90%;
    font-weight: 600;
}

.ai-toast.show {
    bottom: 30px;
}

#updateAppBtn:hover {
    background: #f0f0f0 !important;
    transform: scale(1.05);
}
