/* 
 * БО «БФ ІТІДЖИ» — Landing Page Styles
 * Technical tones, mobile-first, Bootstrap 5 based
 */

:root {
    --tech-blue: #1e3a5f;
    --tech-blue-dark: #152a44;
    --tech-gray: #4a5568;
    --tech-light: #f8fafc;
    --tech-border: #e2e8f0;
    --accent-primary: #2563eb;
    --accent-success: #10b981;
}

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1e293b;
    background: #fff;
    line-height: 1.6;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tech-border);
    padding: 0.5rem 0;
    z-index: 1030;
}

.navbar-brand h1 {
    color: var(--tech-blue);
    font-weight: 600;
}

.navbar-brand small {
    font-size: 0.8rem;
    color: var(--tech-gray);
}

.nav-link {
    color: var(--tech-gray) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--accent-primary) !important;
}

.btn-donate-nav {
    background: var(--accent-primary);
    border: none;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-donate-nav:hover {
    background: #1d4ed8;
}

/* Mobile Back Button */
.btn-back-mobile {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1050;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tech-blue);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s;
}

.btn-back-mobile:hover {
    opacity: 1;
    background: var(--tech-blue-dark);
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
}

.carousel-item {
    height: 70vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85) 0%, rgba(30, 58, 95, 0.6) 100%);
}

.carousel-item .container {
    position: relative;
    z-index: 2;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(30, 58, 95, 0.5);
    border-radius: 50%;
    padding: 1rem;
}

/* Sections */
.section {
    scroll-margin-top: 80px;
}

.section-title {
    color: var(--tech-blue);
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Project Cards */
.project-card {
    border: 1px solid var(--tech-border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-primary);
}

.project-card .card-title {
    color: var(--tech-blue);
    font-weight: 600;
}

/* Project Detail Card */
.project-detail-card {
    border: 2px solid var(--accent-primary);
}

.project-detail-card .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-donate-amount {
    min-width: 100px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-donate-amount:hover,
.btn-donate-amount:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Copy Buttons */
.copy-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.copy-btn:hover {
    background: var(--tech-blue);
    color: white;
}

.font-monospace {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Principles Cards */
.card.border-primary-subtle {
    border-width: 2px;
    transition: border-color 0.2s;
}

.card.border-primary-subtle:hover {
    border-color: var(--accent-primary) !important;
}

.card .bi {
    margin-right: 0.35rem;
}

/* Footer */
.site-footer {
    background: var(--tech-blue-dark);
    color: rgba(255, 255, 255, 0.85);
}

.footer-brand {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.text-muted-hover:hover {
    color: white !important;
    text-decoration: none;
}

/* Utilities */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

.opacity-75 {
    opacity: 0.75 !important;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--tech-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .hero-carousel,
    .carousel-item {
        height: 60vh;
        min-height: 400px;
    }

    .display-5 {
        font-size: 1.75rem !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .card-body.p-4.p-md-5 {
        padding: 1.5rem !important;
    }

    .btn-back-mobile {
        display: flex !important;
    }

    /* Ensure footer links are tappable */
    .site-footer a {
        padding: 0.25rem 0;
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .navbar-brand h1 {
        font-size: 1.1rem;
    }

    .navbar-brand small {
        font-size: 0.7rem;
    }

    .btn-donate-amount {
        min-width: 80px;
        font-size: 0.9rem;
        padding: 0.35rem 0.5rem;
    }

    .input-group-lg .form-control {
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {

    .btn-back-mobile,
    .navbar-toggler,
    .btn,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }

    .site-header {
        position: static;
        background: white;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .card,
    .site-header,
    .site-footer {
        border-width: 2px;
    }

    .text-muted {
        color: #000 !important;
        opacity: 0.8;
    }
}

/* QR Code Wrapper */
.qr-wrapper {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.qr-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.qr-wrapper img {
    display: block;
    border-radius: 8px;
    image-rendering: pixelated;
    /* crisp QR on retina */
}

/* Mobile QR adjustments */
@media (max-width: 576px) {
    .qr-wrapper {
        padding: 1rem !important;
    }

    .qr-wrapper img {
        width: 160px !important;
        height: 160px !important;
    }
}

/* Print: ensure QR is visible */
@media print {
    .qr-wrapper {
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Avatar Photo */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid var(--tech-border);
    transition: border-color 0.2s, transform 0.2s;
    background: var(--tech-light);
}

.avatar-photo:hover {
    border-color: var(--accent-primary);
    transform: scale(1.03);
}

.avatar-photo.fallback {
    border-style: dashed;
    opacity: 0.9;
}

/* Responsive avatar */
@media (max-width: 576px) {
    .avatar-photo {
        width: 100px;
        height: 100px;
    }
}

/* Print: ensure photo is visible */
@media print {
    .avatar-photo {
        border: 2px solid #000 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}