/* ========= Theme variables (mobile-first) ========= */
:root {
    --max-width: 1150px;
    --radius: 12px;
    --focus: 0 0 0 6px rgba(139, 92, 246, 0.12);
    --touch: 48px;
    /* minimum touch target */
}

/* Dark theme (default) */
html[data-theme="dark"] {
    --bg: linear-gradient(90deg, #031017, #072032);
    --card: #0e2130;
    --muted: #93a3b5;
    --text: #e9f0f6;
    --glass: rgba(255, 255, 255, 0.035);
    --glass-strong: rgba(255, 255, 255, 0.06);
    --accent1: #e73c7e;
    --accent2: #8b5cf6;
    --input-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    --border: rgba(255, 255, 255, 0.06);
}

/* Light theme */
html[data-theme="light"] {
    --bg: linear-gradient(180deg, #f6fbff, #eef6ff);
    --card: #ffffff;
    --muted: #3b4b5a;
    --text: #071427;
    --glass: rgba(0, 0, 0, 0.04);
    --glass-strong: rgba(0, 0, 0, 0.06);
    --accent1: #e73c7e;
    --accent2: #8b5cf6;
    --input-bg: linear-gradient(180deg, rgba(10, 18, 28, 0.02), rgba(10, 18, 28, 0.01));
    --border: rgba(10, 18, 28, 0.06);
}

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

html,
body {
    height: 100%
}

body {
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

/* containers */
.container {
    width: 94%;
    max-width: var(--max-width);
    margin: 0 auto
}

/* Header */
.site-header {
    display: flex;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 40;
    background-color: var(--glass-strong);
    border-bottom: 1px solid var(--border)
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

.brand {
    display: flex;
    flex-direction: column
}

.logo {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.05rem
}

.logo span {
    color: var(--accent2)
}

.tagline {
    color: var(--muted);
    font-size: 0.82rem
}

/* nav + header actions */
.main-nav ul {
    padding-left: 50px;
    list-style: none;
    display: flex;
    gap: 50px;
    align-items: center;
}

.main-nav a[href="#features"] {
    color: #00ffff;
    text-decoration: none;
    font-weight: 600;
}

.main-nav a[href="#cards"] {
    color: #ff9900;
    text-decoration: none;
    font-weight: 600;
}

.main-nav a#openModalNav {
    color: #00cc66;
    text-decoration: none;
    font-weight: 600;
}


.header-actions {
    margin-left: auto;
    display: flex;
    gap: 15px;
    align-items: center
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1;
    font-weight: 700;
    font-size: 0.92rem;
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border);
    min-height: calc(var(--touch) - 12px);
}

.btn i {
    font-size: 1rem
}

.btn:active {
    transform: translateY(1px)
}

.btn.primary {
    background: linear-gradient(90deg, var(--accent1), var(--accent2));
    color: #fff;
    border: none
}

.btn.ghost {
    background: transparent
}

.btn.outline {
    background: transparent
}

/* Hero */
.hero {
    padding: 20px 0
}

.hero-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap
}

.hero-left {
    max-width: 620px
}

.hero-left h1 {
    font-size: 1.6rem;
    margin-bottom: 8px
}

.lead {
    color: var(--muted);
    margin-bottom: 12px;
    font-size: 0.95rem
}

.hero-right img {
    max-width: 420px;
    border-radius: 14px;
    opacity: 0.98
}

/* Features */
.features {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    justify-content: space-between;
    flex-wrap: wrap
}

.feature {
    background: var(--card);
    border-radius: 10px;
    padding: 12px;
    flex: 1;
    text-align: center;
    border: 1px solid var(--border);
    min-width: 160px
}

.feature i {
    font-size: 1.4rem;
    color: var(--accent2);
    margin-bottom: 6px
}

.feature h4 {
    margin: 8px 0;
    font-size: 1rem
}

.feature p {
    color: var(--muted);
    font-size: 0.9rem
}

/* Controls */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    flex: 1;
    min-width: 150px
}

.search i {
    color: var(--muted)
}

.search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    width: 100%;
    padding: 8px 6px
}

/* Filters */
.filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

.filters select {
    padding: 8px 10px;
    background: var(--input-bg);
    color: var(--text);
    border-radius: 8px;
    border: 1px solid var(--border)
}

/* grid for cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 12px;
    padding-bottom: 30px;
}

/* Card */
.card {
    background: var(--card);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
    z-index: 1;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0b2540, #072a3a);
    color: #fff;
    font-weight: 700;
    font-size: 18px
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.card-body {
    flex: 1;
    min-width: 0
}

.card-body h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.card-body p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

/* Badges */
.badge {
    padding: 6px 8px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.7rem;
    color: #051224;
    margin-left: 6px
}

.cat-emergency {
    background: #ff7a7a
}

.cat-important {
    background: #ffd08a
}

.cat-urgent {
    background: #ffb06b
}

.cat-no-rush {
    background: #9ad0ff
}

/* Actions inside card */
.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap
}

.actions-left {
    display: flex;
    gap: 8px;
    align-items: center
}

.actions-right {
    display: flex;
    gap: 50px;
    align-items: center
}

.actions .btn {
    padding: 8px 10px;
    font-size: 0.9rem
}

.icon-only {
    padding: 8px;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px
}

/* Empty state */
.empty {
    text-align: center;
    padding: 24px;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: 10px;
    margin-top: 12px
}

/* Footer centered */
.site-footer {
    padding: 18px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    z-index: 2
}

.footer-inner {
    display: flex;
    justify-content: center;
    width: 100%
}

.footer-center {
    text-align: center;
    max-width: 900px
}

.dev-credit {
    margin: 8px 20px;
    color: var(--muted)
}

.socials {
    margin: 8px 0
}

.social-link {
    color: var(--muted);
    margin: 0 6px;
    text-decoration: none;
    font-size: 1.2rem
}

/* Modal & form */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60
}

.modal[aria-hidden="false"] {
    display: flex
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5)
}

.modal-panel {
    position: relative;
    z-index: 70;
    width: 94%;
    max-width: 720px;
    background: var(--card);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(2, 6, 23, 0.5)
}

.modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    background: transparent;
    border: none;
    font-size: 26px;
    color: var(--muted);
    cursor: pointer
}

/* Form basics */
.form {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

input[type="text"],
input[type="url"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    box-shadow: var(--focus)
}

.radio-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.radio {
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--border);
    font-weight: 700;
    cursor: pointer
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap
}

.hint {
    margin-left: auto;
    color: var(--muted)
}

.req {
    color: #ff7575
}

/* Contact form floating labels (input-group) */
.input-group {
    position: relative;
    margin-top: 6px
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    resize: vertical;
}

.input-group label {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    pointer-events: none;
    transition: all .18s ease;
    background: transparent;
    padding: 0 4px;
}

/* placeholder trick: use placeholder=" " to enable :not(:placeholder-shown) */
.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label,
.input-group textarea:focus+label,
.input-group textarea:not(:placeholder-shown)+label {
    transform: translateY(-22px) scale(.92);
    color: var(--accent2);
    background: transparent;
}

/* contact status */
.contact-status {
    font-weight: 600;
    color: var(--muted)
}

/* helpers */
.sr-only {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important
}

.visually-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important
}

.small {
    color: var(--muted);
    font-size: 0.88rem
}

kbd {
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 6px;
    border-radius: 6px
}

/* Responsive tweaks */
@media (min-width:760px) {
    .hero-left h1 {
        font-size: 2rem
    }

    .avatar {
        width: 76px;
        height: 76px;
        font-size: 18px
    }
}

@media (max-width:520px) {
    .hero {
        display: flex;
    }

    .hero-right img {
        max-width: 100%;

    }

    .header-inner {
        gap: 8px
    }

    .main-nav ul {
        display: none;
    }

    ;

    .btn {
        font-size: 0.9rem;
        padding: 10px 12px
    }

    .card {
        padding: 10px;
        gap: 10px
    }

    .actions .btn {
        padding: 10px 12px;
        min-height: 40px
    }

    .actions-right .icon-only {
        width: 36px;
        height: 36px
    }

    .hero-left h1 {
        font-size: 1.25rem
    }

    .features {
        gap: 8px;
    }
}

/* ===== Loader Styles ===== */
#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
  color: #fff;
  font-family: 'Poppins', sans-serif;
}

.loader-logo {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: bounce 1.5s infinite;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #00b4d8;
  border-radius: 50%;
  margin: 0 auto 15px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

#loader p {
  font-size: 0.95rem;
  opacity: 0.8;
  letter-spacing: 0.5px;
}
