/* =============================================================
   style.css — Structural styles for contact.newandu.et
   -------------------------------------------------------------
   Only layout, spacing, typography, and behaviour.
   ALL colour values come from CSS variables defined in themes.css.
   ============================================================= */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    accent-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* Animated gradient background (uses theme variables) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, var(--body-grad-1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, var(--body-grad-2) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
    position: absolute !important;
    top: -9999px !important;
    left: 1rem;
    z-index: 10000;
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: top 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0 !important;
}

.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Layout wrapper ---------- */
.site-header,
.main-content,
.site-footer {
    position: relative;
    z-index: 1;
}

/* ---------- HEADER ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 64px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity var(--transition);
}

.brand:hover {
    opacity: 0.85;
}

.brand-logo {
    width: 32px;
    height: 32px;
    transition: filter var(--transition);
}

.brand-text {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.brand-accent {
    color: var(--accent);
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--emerald);
    background: var(--emerald-light);
    border: 1px solid var(--emerald-border);
    padding: 4px 10px;
    border-radius: 100px;
}

.badge-online .dot {
    width: 6px;
    height: 6px;
    background: var(--emerald);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.nav-btn:hover {
    opacity: 0.88;
}

.nav-btn-ghost {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--border);
}

.nav-btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--accent-light);
}

.nav-btn-primary {
    color: #fff;
    background: var(--accent);
}

.nav-btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-shadow);
}

.nav-btn-danger {
    color: var(--danger);
    background: transparent;
    border-color: var(--danger-border);
}

.nav-btn-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

.global-theme-btn,
.global-lang-btn,
.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    text-decoration: none;
    font-family: inherit;
}

.global-theme-btn:hover,
.global-lang-btn:hover,
.header-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.global-theme-btn .icon,
.global-lang-btn .icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* ---------- MAIN ---------- */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ---------- HERO ---------- */
.hero {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 1.25rem;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-wrap: balance;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
    text-wrap: pretty;
}

/* ---------- CARDS ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
}

/* AUTH CARD */
.auth-card {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.auth-title strong {
    color: var(--accent);
}

.auth-body {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.auth-note {
    font-size: 0.77rem;
    color: var(--text-muted);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.65rem 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    user-select: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 24px var(--accent-shadow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent-border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--accent-light);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

/* FEATURES GRID */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---------- SEARCH CARD ---------- */
.search-card {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.search-icon-wrap {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.search-subtitle {
    font-size: 0.83rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-prefix {
    padding: 0 14px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
    user-select: none;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.8rem 0.5rem;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.8rem 1.4rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-result {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 1rem;
    transition: all var(--transition);
}

.result-success {
    background: var(--emerald-light);
    border: 1px solid var(--emerald-border);
    color: var(--emerald);
}

.result-error {
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    color: var(--danger-soft);
}

/* Utility */
.hidden {
    display: none !important;
}

/* ---------- RECENT SEARCHES ---------- */
.recent-section {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.recent-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.recent-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.recent-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ---------- LINK ---------- */
.link {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

.link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ---------- FOOTER ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-footer);
}

.footer-sub {
    margin-top: 4px;
    font-size: 0.72rem;
    opacity: 0.8;
}

/* ---------- ANIMATIONS ---------- */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    animation: fadeInUp 0.5s ease both;
}

.card {
    animation: fadeInUp 0.5s ease 0.1s both;
}

.features-grid {
    animation: fadeInUp 0.5s ease 0.2s both;
}

/* ---------- RESPONSIVE ---------- */
/* Medium Screen Sizes (Tablets & Small Laptops: 601px - 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    .header-inner {
        max-width: 100%;
        min-height: 60px;
        height: auto;
        padding: 0.6rem 1.25rem;
        gap: 0.75rem;
    }

    .brand {
        gap: 8px;
    }

    .brand-text {
        font-size: 1rem;
    }

    .brand-sub {
        font-size: 0.6rem;
        padding: 1px 5px;
    }

    .header-nav {
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    .global-theme-btn,
    .global-lang-btn,
    .notif-bell-wrap {
        height: 30px;
        padding: 0 8px;
        font-size: 0.76rem;
    }
}

/* Retractable Top Navigation Hamburger Toggle Button (Desktop Base) */
.top-nav-toggle-btn {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
    transition: background var(--transition), border-color var(--transition);
}

.top-nav-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.top-nav-toggle-btn .hamburger-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-close-btn {
    display: none;
    align-self: flex-end;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.nav-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

@media (max-width: 768px) {
    .main-content {
        padding: 2rem 1rem 3rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .auth-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-actions .btn {
        justify-content: center;
    }

    .search-btn {
        padding: 0.8rem 1rem;
    }

    /* Retractable Top Navigation Hamburger Toggle Button */
    .top-nav-toggle-btn {
        display: inline-flex;
        background: var(--bg-surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 8px 10px;
        cursor: pointer;
        flex-direction: column;
        gap: 4px;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        margin-left: auto;
        transition: background var(--transition), border-color var(--transition);
    }

    .top-nav-toggle-btn:hover {
        background: var(--bg-card-hover);
        border-color: var(--border-hover);
    }

    .top-nav-toggle-btn .hamburger-bar {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .top-nav-toggle-btn[aria-expanded="true"] .hamburger-bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .top-nav-toggle-btn[aria-expanded="true"] .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .top-nav-toggle-btn[aria-expanded="true"] .hamburger-bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .header-inner {
        position: relative;
        min-height: 56px;
        height: auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .brand-sub {
        display: none;
    }

    .badge-online {
        display: none;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--bg-header);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem;
        gap: 0.65rem;
        z-index: 1000;
        animation: contactTopNavSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .header-nav.is-open {
        display: flex;
    }

    .header-nav.is-open .nav-close-btn {
        display: inline-flex;
    }

    .header-nav .nav-btn,
    .header-nav .global-theme-btn,
    .header-nav .global-lang-btn,
    .header-nav .logout-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        font-size: 0.92rem;
        padding: 0.65rem 1rem;
        text-align: center;
    }

    .header-nav .notif-bell-wrap {
        width: 100%;
        justify-content: center;
    }

    .header-nav .logout-form {
        width: 100%;
    }

    @keyframes contactTopNavSlide {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0.35rem 0.5rem;
        gap: 0.25rem;
    }

    .brand-text {
        font-size: 0.95rem;
    }

    .brand-logo {
        width: 26px;
        height: 26px;
    }

    .header-nav {
        gap: 0.25rem;
    }

    .nav-btn {
        padding: 4px 6px;
        font-size: 0.72rem;
    }
}

/* Location Permission Callout */
.location-permission-callout {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(14, 165, 233, 0.35);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.location-permission-callout .loc-callout-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.location-permission-callout .loc-callout-text {
    flex: 1;
}

.location-permission-callout .loc-callout-text h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.location-permission-callout .loc-callout-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.loc-callout-btn {
    white-space: nowrap;
    min-height: 44px;
    padding: 0 1.25rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .location-permission-callout {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .loc-callout-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---------- PRINT ---------- */
@media print {

    body::before,
    .site-header,
    .site-footer,
    .global-theme-btn,
    .global-lang-btn,
    .header-nav {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        background: #fff;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}