/* Calendar Ethiopian Minimalist Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #111827;
    --primary-hover: #374151;
    --secondary: #4b5563;
    --accent: #2563eb;
    --bg-main: #f9fafb;
    --bg-mesh: #f9fafb; /* Replaced mesh with solid light gray */
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --success: #10b981;
    --error: #ef4444;
    --shadow-soft: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-mesh);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* Utility */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
a { text-decoration: none; color: var(--accent); transition: var(--transition); }
a:hover { color: #1d4ed8; text-decoration: underline; }

/* Clean Minimal Panels */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* Header */
header {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}
.logo:hover { text-decoration: none; color: var(--text-main); }
.logo-icon { 
    width: 32px; 
    height: 32px; 
    border-radius: 8px; 
    background: var(--text-main);
    padding: 6px;
    object-fit: contain;
}

.nav-desktop { display: flex; gap: 32px; }
.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 4px;
}
.nav-link:hover { color: var(--text-main); text-decoration: none; }
.nav-link.active { color: var(--text-main); font-weight: 600; }
.nav-link.active::after {
    content: ''; position: absolute; bottom: -24px; left: 0; width: 100%; height: 2px;
    background: var(--text-main);
}

/* Mobile Menu Button */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); }

/* Hero Section */
.hero { padding: 60px 0 40px; text-align: center; }
.hero h1 {
    font-size: 3rem; font-weight: 800; line-height: 1.1; margin-bottom: 16px;
    color: var(--text-main);
    letter-spacing: -1px;
}
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 650px; margin: 0 auto; }

/* Breadcrumb */
.breadcrumb { padding: 16px 0; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-main); text-decoration: none; }
.breadcrumb-separator { margin: 0 8px; opacity: 0.5; }

/* Cards & Converter Container */
.converter-card { margin: 0 auto 60px; padding: 40px; }

/* Tabs */
.converter-tabs { display: flex; gap: 8px; margin-bottom: 40px; justify-content: center; background: #f3f4f6; padding: 6px; border-radius: var(--radius-md); max-width: 400px; margin-left: auto; margin-right: auto; }
.converter-tab {
    flex: 1; text-align: center;
    padding: 10px 16px; font-weight: 600; font-size: 0.95rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
}
.converter-tab:hover { color: var(--text-main); }
.converter-tab.active {
    background: #ffffff; color: var(--text-main);
    box-shadow: var(--shadow-soft);
}

.converter-content { display: none; }
.converter-content.active { display: block; animation: fadeIn 0.3s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Forms & Inputs */
.converter-section { margin-bottom: 20px; }
.converter-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin-bottom: 20px; text-align: center; }
.converter-form, .calculator-form { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }

.form-group { flex: 1; min-width: 120px; max-width: 180px; }
.form-control, .operation-select, .calculator-input {
    width: 100%; padding: 12px 16px; font-size: 1rem; font-family: inherit; font-weight: 500;
    color: var(--text-main); background: #ffffff; border: 1px solid var(--card-border);
    border-radius: var(--radius-sm); transition: border-color 0.2s; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
.calculator-input { background-image: none; text-align: center; max-width: 80px; }
.form-control:focus, .operation-select:focus, .calculator-input:focus {
    outline: none; border-color: var(--text-main);
}

.calculator-input-group { display: flex; gap: 0; align-items: center; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--card-border); overflow: hidden; }
.calculator-input-group div { display: flex; align-items: center; }
.calculator-input-group .calculator-input { border: none; border-right: 1px solid var(--card-border); border-radius: 0; }
.calculator-input-group .calculator-label { padding: 0 16px; font-weight: 500; font-size: 0.9rem; color: var(--text-muted); background: #f9fafb; height: 100%; display: flex; align-items: center; border-left: 1px solid var(--card-border);}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px; font-family: inherit; font-weight: 600; font-size: 1rem;
    border-radius: var(--radius-sm); cursor: pointer; border: none; transition: var(--transition);
}
.btn-primary {
    background: var(--text-main);
    color: white; 
}
.btn-primary:hover { background: var(--primary-hover); }

/* Results */
.result-container {
    display: none; align-items: center; justify-content: space-between;
    margin-top: 32px; padding: 20px 24px; background: #f9fafb;
    border-radius: var(--radius-md); border: 1px solid var(--card-border);
}
.result-container.active { display: flex; }
.result-text { font-size: 1.15rem; font-weight: 600; color: var(--text-main); }
.error-text { color: var(--error); font-weight: 500; }
.copy-btn {
    background: #ffffff; border: 1px solid var(--card-border); width: 40px; height: 40px;
    border-radius: var(--radius-sm); color: var(--text-main); cursor: pointer;
    font-size: 1rem; display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.copy-btn:hover { background: #f3f4f6; }

hr { border: 0; height: 1px; background: var(--card-border); margin: 32px 0; }


/* Calendar Specifics */
.calendar-container { padding: 40px; margin-bottom: 60px; }
.calendar-header { display: flex; gap: 12px; justify-content: center; align-items: center; margin-bottom: 24px; }
.calendar-title { font-size: 1.5rem; font-weight: 700; color: var(--text-main); text-align: center; margin-bottom: 20px; letter-spacing: -0.5px; }
.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--card-border); border: 1px solid var(--card-border); border-radius: var(--radius-md); overflow: hidden;
}
.calendar-grid div {
    background: #ffffff; padding: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.calendar-grid .header { background: #f3f4f6; color: var(--text-main); font-weight: 600; padding: 12px 4px; }
.calendar-grid .header .amharic { font-size: 1rem; }
.calendar-grid .header .english { font-size: 0.75rem; opacity: 0.6; margin-top: 2px; text-transform: uppercase; }
.calendar-grid .day:hover { background: #f9fafb; }
.calendar-grid .day { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
.calendar-grid .day .gregorian { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.calendar-grid .today { background: var(--text-main); color: #fff; }
.calendar-grid .today:hover { background: var(--primary-hover); }
.calendar-grid .today .gregorian { color: rgba(255,255,255,0.7); }
.calendar-grid .empty { background: #f9fafb; }


/* Today Page Specifics */
.date-display-card { padding: 40px; }
.unified-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.date-stat-card {
    background: #ffffff; border-radius: var(--radius-md); padding: 32px;
    text-align: center; border: 1px solid var(--card-border);
}
.stat-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.stat-value { font-size: 2.5rem; font-weight: 800; color: var(--text-main); line-height: 1; margin-bottom: 12px; letter-spacing: -1px; }
.stat-detail { font-size: 1rem; font-weight: 500; color: var(--text-muted); padding-top: 16px; border-top: 1px solid var(--card-border); }


/* Features / SEO Text */
.features { padding: 60px 0; }
.section-title { font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 40px; color: var(--text-main); letter-spacing: -0.5px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 60px; }
.feature-card {
    background: #ffffff; padding: 32px; border-radius: var(--radius-md);
    text-align: left; border: 1px solid var(--card-border);
}
.feature-icon { font-size: 1.5rem; margin-bottom: 20px; color: var(--text-main); }
.feature-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

.content-section {
    background: #ffffff; padding: 40px; border-radius: var(--radius-md);
    border: 1px solid var(--card-border); margin: 0 auto; max-width: 900px;
}
.content-section h2 { 
    font-size: 1.5rem; font-weight: 700; margin: 32px 0 16px; color: var(--text-main); 
    letter-spacing: -0.5px; padding-left: 14px; border-left: 4px solid var(--accent); border-radius: 2px;
}
.content-section h2:first-child { margin-top: 0; }
.content-section h3 { font-size: 1.2rem; font-weight: 600; margin: 24px 0 12px; }
.content-section p { font-size: 1rem; margin-bottom: 16px; color: var(--text-muted); }
.content-section ul { margin-left: 24px; margin-bottom: 16px; }
.content-section li { margin-bottom: 8px; font-size: 1rem; color: var(--text-muted); }

/* Footer */
footer { border-top: 1px solid var(--card-border); background: #ffffff; color: var(--text-muted); padding: 32px 0; text-align: center; margin-top: auto; font-size: 0.9rem; font-weight: 500; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--text-main); }
.copyright { opacity: 0.8; }

/* Social Sharing */
.sharing { padding: 60px 0; background: #ffffff; border-top: 1px solid var(--card-border); }
.sharing-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin-bottom: 24px; text-align: center; letter-spacing: -0.5px; }
.social-share { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.social-share-btn {
    padding: 12px 24px; border-radius: 100px; font-weight: 600; font-size: 0.95rem;
    display: inline-flex; align-items: center; gap: 8px; transition: var(--transition);
    border: 1px solid var(--card-border); color: var(--text-muted); background: #ffffff;
    cursor: pointer;
}
.social-share-btn i { font-size: 1.1rem; }
.social-share-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.social-share-btn.facebook:hover { background: #1877F2; color: #fff; border-color: #1877F2; }
.social-share-btn.whatsapp:hover { background: #25D366; color: #fff; border-color: #25D366; }
.social-share-btn.x:hover { background: #000000; color: #fff; border-color: #000000; }
.social-share-btn.telegram:hover { background: #0088cc; color: #fff; border-color: #0088cc; }
.social-share-btn.copy-link:hover { background: var(--text-main); color: #fff; border-color: var(--text-main); }

/* popup */
.popup {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--text-main); color: #fff; padding: 12px 20px;
    border-radius: var(--radius-sm); font-weight: 500; font-size: 0.95rem;
    box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden;
    transition: var(--transition); z-index: 2000; transform: translateY(10px);
}
.popup.active { opacity: 1; visibility: visible; transform: translateY(0); }

/* Today Banner at Bottom */
#current-dates { margin: 40px auto 0; max-width: 800px; }
.today-banner {
    display: flex; justify-content: center; align-items: center; gap: 32px;
    padding: 24px;
}
.today-badge { display: flex; flex-direction: column; align-items: center; }
.badge-label {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-muted); margin-bottom: 4px; font-weight: 600;
}
.badge-date { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.today-divider { width: 1px; height: 32px; background: var(--card-border); }

/* Responsive */
@media (max-width: 900px) {
    .calendar-grid { border: none; background: transparent; gap: 4px; }
    .calendar-grid div { border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 8px; }
    .calendar-grid .day { font-size: 1.1rem; }
    .unified-date-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .nav-desktop {
        display: none; position: absolute; top: 72px; left: 0; width: 100%;
        background: #ffffff; border-bottom: 1px solid var(--card-border);
        flex-direction: column; align-items: center; padding: 24px 0;
        box-shadow: var(--shadow-soft);
    }
    .nav-desktop.mobile-active { display: flex; }
    .mobile-menu-btn { display: block; }
    
    /* Layout Spacing */
    .converter-card { padding: 24px 16px; margin-bottom: 40px; }
    .content-section { padding: 28px 16px; }
    .features-grid { grid-template-columns: 1fr; }

    /* Form Grids for Mobile */
    .converter-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch;}
    .converter-form .form-group, .converter-form .form-control { max-width: 100%; width: 100%; margin: 0; }
    .converter-form .form-group:nth-child(1) { order: 1; } /* Day */
    .converter-form .form-group:nth-child(3) { order: 2; } /* Year */
    .converter-form .form-group:nth-child(2) { order: 3; grid-column: span 2; } /* Month */
    .convert-btn-container { order: 4; grid-column: span 2; width: 100%; }
    .convert-btn-container .btn { width: 100%; }

    /* Calculator Form */
    .calculator-form { display: flex; flex-direction: column; gap: 16px; }
    .date-input-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
    .date-input-group .form-group, .date-input-group .form-control { max-width: 100%; width: 100%; margin: 0; }
    .date-input-group .form-group:nth-child(1) { order: 1; }
    .date-input-group .form-group:nth-child(3) { order: 2; }
    .date-input-group .form-group:nth-child(2) { order: 3; grid-column: span 2; }
    
    .operation-input-group { flex-direction: column; width: 100%; gap: 12px; }
    .calculator-input-group { width: 100%; }
    .converter-card { padding: 20px; margin: -30px 16px 40px; }
    .calendar-container { padding: 20px; margin: -30px 16px 40px; }
    .calendar-header { flex-wrap: wrap; }
    .calendar-header .operation-select { flex: 1 1 40%; min-width: 120px; }
    .calendar-header .btn { flex: 1 1 100%; }
    .unified-date-grid { grid-template-columns: 1fr; }
    .today-banner { flex-direction: column; gap: 16px; padding: 20px; }
    .today-divider { width: 40%; height: 1px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .converter-card { padding: 16px; margin: -20px 0 30px; }
    .calendar-container { padding: 12px 8px; margin: 0 0 30px; overflow-x: hidden; }
    .calendar-grid { min-width: 100%; border: none; }
    .calendar-grid div { padding: 8px 2px; }
    .hero { padding: 40px 0 20px; }
    .hero h1 { font-size: 1.75rem; word-break: break-word; }
    .hero p { font-size: 0.95rem; padding: 0 10px; }
    .logo { font-size: 1.15rem; gap: 8px; }
    .logo-icon { width: 28px; height: 28px; padding: 4px; }
    .calendar-title { font-size: 1.15rem; line-height: 1.3; }
    .calendar-grid .header .amharic { font-size: 0.75rem; }
    .calendar-grid .header .english { font-size: 0.55rem; letter-spacing: -0.5px; }
    .calendar-grid .day { font-size: 0.9rem; }
    .calendar-grid .day .gregorian { font-size: 0.65rem; }
    
    .holidays-table th, .holidays-table td { padding: 8px 6px; font-size: 0.8rem; }
    .badge { padding: 2px 4px; font-size: 0.6rem; letter-spacing: 0; }

    /* Box fixes for mobile edges */
    .content-section { padding: 24px 16px; }
    .content-section h2 { margin-left: 0; padding-left: 10px; font-size: 1.35rem; }
}
/* Table Styles */
.holidays-table-wrapper { width: 100%; overflow-x: auto; margin-bottom: 24px; border-radius: var(--radius-md); border: 1px solid var(--card-border); -webkit-overflow-scrolling: touch; }
.holidays-table { width: 100%; border-collapse: collapse; text-align: left; background: var(--card-bg); min-width: 500px; }
.holidays-table th, .holidays-table td { padding: 16px 20px; border-bottom: 1px solid var(--card-border); }
.holidays-table th { background: #f3f4f6; color: var(--text-main); font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; }
.holidays-table tr:last-child td { border-bottom: none; }
.holidays-table tbody tr:hover { background: #f9fafb; }
.holidays-table td { color: var(--text-muted); font-size: 0.95rem; }
.holidays-table td.strong { color: var(--text-main); font-weight: 600; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.badge-fixed { background: #e0e7ff; color: #3730a3; }
.badge-floating { background: #fce7f3; color: #be185d; }


/* ===== Calendar Day Modal ===== */
#cal-day-modal {
    display: none;
    position: fixed; inset: 0; z-index: 3000;
    align-items: center; justify-content: center;
}
#cal-day-modal.active { display: flex; }
.cal-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(3px);
}
.cal-modal-box {
    position: relative; z-index: 1;
    background: #ffffff; border-radius: 16px;
    padding: 36px 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    min-width: 300px; max-width: 380px; width: 90%;
    text-align: center;
    animation: modalPop 0.22s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.cal-modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; font-size: 1.2rem; cursor: pointer;
    color: var(--text-muted); line-height: 1; padding: 4px 8px; border-radius: 6px;
    transition: var(--transition);
}
.cal-modal-close:hover { background: #f3f4f6; color: var(--text-main); }
.cal-modal-eth-date {
    font-size: 1.55rem; font-weight: 800; color: var(--text-main);
    letter-spacing: -0.5px; margin-bottom: 6px;
}
.cal-modal-greg-date {
    font-size: 1rem; font-weight: 500; color: var(--text-muted); margin-bottom: 4px;
}
.cal-modal-day {
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); font-weight: 600; margin-bottom: 20px;
}
.cal-modal-holiday {
    display: none;
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    border: 1px solid #fbbf24; border-radius: 10px;
    padding: 14px 16px; margin-top: 4px;
}
.holiday-badge {
    display: block; font-weight: 700; font-size: 1rem; color: #92400e; margin-bottom: 4px;
}
.holiday-amharic {
    display: block; font-size: 0.9rem; color: #b45309; font-weight: 500;
}

/* ===== Holiday cells in Grid ===== */
.calendar-grid .day.holiday-day {
    background: #fffbeb;
    position: relative;
}
.calendar-grid .holiday-dot {
    display: block; width: 6px; height: 6px; border-radius: 50%;
    background: #f59e0b; margin: 3px auto 0; flex-shrink: 0;
}
.calendar-grid .today.holiday-day { background: var(--text-main); }
.calendar-grid .today .holiday-dot { background: #fde68a; }
