/* ===========================
   Root Variables & Reset
   =========================== */
:root {
    --primary-color: #1e3a5f;
    --primary-light: #2c5282;
    --primary-dark: #1a365d;
    --accent-color: #d4af37;
    --accent-light: #f0d878;
    --bg-dark: #0d1b2a;
    --bg-card: rgba(30, 58, 95, 0.25);
    --bg-card-hover: rgba(30, 58, 95, 0.45);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(212, 175, 55, 0.45);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glow-color: rgba(212, 175, 55, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Almarai', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===========================
   Background Animation
   =========================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(30, 58, 95, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 175, 55, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 54, 93, 0.5) 0%, transparent 70%);
    animation: gradientMove 15s ease-in-out infinite;
}

.bg-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(212, 175, 55, 0.06) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px, 40px 40px;
    animation: patternFloat 20s linear infinite;
}

@keyframes gradientMove {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(2deg);
    }
}

@keyframes patternFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-40px);
    }
}

/* ===========================
   Container
   =========================== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* ===========================
   Logo Section
   =========================== */
.logo-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow:
        0 0 30px var(--glow-color),
        0 10px 40px var(--shadow-color);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 50px var(--glow-color),
        0 15px 50px var(--shadow-color);
}

.logo-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    opacity: 0.3;
    animation: ringPulse 3s ease-in-out infinite;
}

.logo-ring.delay-1 {
    animation-delay: 1s;
}

.logo-ring.delay-2 {
    animation-delay: 2s;
}

@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ===========================
   Title Section
   =========================== */
.title-section {
    text-align: center;
    margin-bottom: 40px;
}

.main-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    line-height: 1.5;
    white-space: nowrap;
}

.subtitle {
    font-size: 1rem;
    color: var(--accent-light);
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 20px;
}

.honorific {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.separator {
    width: 80%;
    max-width: 300px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: 0 auto;
    border-radius: 2px;
}

/* ===========================
   Links Container
   =========================== */
.links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 50px;
}

/* ===========================
   Link Card
   =========================== */
.link-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.6s ease-out backwards;
    animation-delay: var(--delay);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 0 30px var(--glow-color);
}

.link-card:hover::before {
    opacity: 1;
}

.link-card:active {
    transform: translateY(-2px) scale(1);
}

/* Link Icon */
.link-icon {
    width: 65px;
    height: 65px;
    min-width: 65px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.link-card:hover .link-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.link-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Link Content */
.link-content {
    flex: 1;
    text-align: right;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.link-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Link Arrow */
.link-arrow {
    color: var(--accent-color);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.link-card:hover .link-arrow {
    opacity: 1;
    transform: translateX(-5px);
}

/* ===========================
   Bottom Logo
   =========================== */
.bottom-logo-container {
    margin-top: auto;
    margin-bottom: 20px;
    padding: 20px;
    display: flex;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bottom-logo {
    max-width: 450px;
    height: auto;
    opacity: 0.9;
    filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.bottom-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ===========================
   QR Code Button & Modal
   =========================== */
.qr-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.qr-button:hover {
    background: var(--bg-card-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--shadow-color), 0 0 20px var(--glow-color);
}

.qr-button svg {
    width: 24px;
    height: 24px;
}

/* QR Modal */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qr-modal.active {
    opacity: 1;
    visibility: visible;
}

.qr-modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px var(--glow-color);
}

.qr-modal.active .qr-modal-content {
    transform: scale(1);
}

.qr-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 3px solid var(--bg-dark);
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.qr-close:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.qr-modal-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.qr-modal-image {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    display: inline-block;
}

.qr-modal-image img {
    width: 180px;
    height: 180px;
    display: block;
}

/* ===========================
   Visitor Counter
   =========================== */
.visitor-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: fadeIn 1s ease-out 0.8s backwards;
}

.visitor-counter svg {
    color: var(--accent-color);
}

.visitor-counter #visitorCount {
    color: var(--accent-light);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ===========================
   Footer
   =========================== */
.footer {
    text-align: center;
    padding: 20px;
    width: 100%;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===========================
   Responsive Design
   =========================== */

/* Extra Small Phones (320px and below) */
@media (max-width: 360px) {
    .container {
        padding: 20px 12px;
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .logo-ring {
        width: 100px;
        height: 100px;
    }

    .logo-container {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }

    .main-title {
        font-size: 0.95rem;
        white-space: normal;
        line-height: 1.6;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .separator {
        width: 60%;
    }

    .link-card {
        padding: 12px 14px;
        gap: 10px;
        border-radius: 12px;
    }

    .link-icon {
        width: 45px;
        height: 45px;
        min-width: 45px;
        border-radius: 10px;
    }

    .link-icon img {
        width: 26px;
        height: 26px;
    }

    .link-title {
        font-size: 0.9rem;
    }

    .link-description {
        font-size: 0.75rem;
    }

    .link-arrow svg {
        width: 16px;
        height: 16px;
    }

    .bottom-logo {
        max-width: 280px;
    }

    .qr-button {
        width: 40px;
        height: 40px;
        top: 15px;
        left: 15px;
    }

    .qr-button svg {
        width: 20px;
        height: 20px;
    }

    .qr-modal-content {
        padding: 25px 20px;
        margin: 15px;
        border-radius: 20px;
    }

    .qr-modal-image img {
        width: 140px;
        height: 140px;
    }

    .qr-close {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Small Phones (361px - 480px) */
@media (min-width: 361px) and (max-width: 480px) {
    .container {
        padding: 25px 16px;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .logo-ring {
        width: 120px;
        height: 120px;
    }

    .logo-container {
        width: 120px;
        height: 120px;
    }

    .main-title {
        font-size: 1.1rem;
        white-space: normal;
        line-height: 1.5;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .link-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .link-icon {
        width: 55px;
        height: 55px;
        min-width: 55px;
    }

    .link-icon img {
        width: 32px;
        height: 32px;
    }

    .link-title {
        font-size: 1rem;
    }

    .link-description {
        font-size: 0.8rem;
    }

    .bottom-logo {
        max-width: 350px;
    }

    .qr-modal-content {
        margin: 20px;
    }

    .qr-modal-image img {
        width: 160px;
        height: 160px;
    }
}

/* Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 40px 24px;
        max-width: 520px;
    }

    .logo {
        width: 130px;
        height: 130px;
    }

    .logo-ring {
        width: 150px;
        height: 150px;
    }

    .logo-container {
        width: 150px;
        height: 150px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .link-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .link-icon img {
        width: 36px;
        height: 36px;
    }

    .bottom-logo {
        max-width: 380px;
    }

    .qr-button {
        width: 55px;
        height: 55px;
    }
}

/* Large Tablets & Small Desktops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 50px 30px;
        max-width: 560px;
    }

    .logo {
        width: 150px;
        height: 150px;
    }

    .logo-ring {
        width: 170px;
        height: 170px;
    }

    .logo-container {
        width: 170px;
        height: 170px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .link-card {
        padding: 20px 24px;
    }

    .link-icon {
        width: 70px;
        height: 70px;
        min-width: 70px;
    }

    .link-icon img {
        width: 42px;
        height: 42px;
    }

    .link-title {
        font-size: 1.15rem;
    }

    .bottom-logo {
        max-width: 380px;
    }
}

/* Large Desktops (1025px and above) */
@media (min-width: 1025px) {
    .container {
        padding: 60px 40px;
        max-width: 600px;
    }

    .logo {
        width: 160px;
        height: 160px;
    }

    .logo-ring {
        width: 180px;
        height: 180px;
    }

    .logo-container {
        width: 180px;
        height: 180px;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .link-card {
        padding: 22px 28px;
        gap: 18px;
    }

    .link-card:hover {
        transform: translateY(-8px) scale(1.03);
    }

    .link-icon {
        width: 75px;
        height: 75px;
        min-width: 75px;
        border-radius: 16px;
    }

    .link-icon img {
        width: 45px;
        height: 45px;
    }

    .link-title {
        font-size: 1.2rem;
    }

    .link-description {
        font-size: 0.95rem;
    }

    .bottom-logo {
        max-width: 400px;
    }

    .qr-button {
        width: 55px;
        height: 55px;
        top: 25px;
        left: 25px;
    }

    .qr-modal-image img {
        width: 200px;
        height: 200px;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.link-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.link-card:focus:not(:focus-visible) {
    outline: none;
}

.link-card:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}