/* ==========================================================================
   AFROBYTE TECHNOLOGIES - CORE CSS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & THEME TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Fonts */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease-in-out;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);

    /* Spacing */
    --section-pad: 5rem 0;
    --container-width: 1200px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Light Theme Variables */
:root[data-theme="light"] {
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;

    /* Primary brand colors */
    --brand-primary: #2563eb;
    --brand-secondary: #0ea5e9;

    /* Gradient text */
    --gradient-brand: linear-gradient(135deg, #2563eb, #0ea5e9);

    /* Surfaces / Glass */
    --surface: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* Dark Theme Variables (Premium Tech Look like ByteDance/Tencent) */
:root[data-theme="dark"] {
    --bg-color: #030712;
    --bg-alt: #0b1120;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #1e293b;

    /* Primary brand colors */
    --brand-primary: #3b82f6;
    /* Brighter for dark mode */
    --brand-secondary: #38bdf8;

    /* Gradient text */
    --gradient-brand: linear-gradient(135deg, #60a5fa, #38bdf8);

    /* Surfaces / Glass */
    --surface: rgba(15, 23, 42, 0.8);
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: var(--brand-primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand-secondary);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: var(--section-pad);
}

.bg-alt {
    background-color: var(--bg-alt);
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------------------
   3. COMPONENTS
   -------------------------------------------------------------------------- */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff !important;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--brand-secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary) !important;
    background: rgba(59, 130, 246, 0.05);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-alt);
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   4. LAYOUT / HEADER / FOOTER
   -------------------------------------------------------------------------- */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-medium);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 200px;
    height: 100px;
    /* transition: content var(--transition-medium); CSS 'content' doesn't transition well natively, but it swaps instantly */
}

/* Logo Switching based on Theme */
[data-theme="dark"] .logo img {
    content: url('../../assets/images/logos/afrobytelogo white.svg');
}
[data-theme="light"] .logo img {
    content: url('../../assets/images/logos/afrobytelogo black.svg');
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--text-primary) !important;
}

.logo .dot {
    color: var(--brand-primary);
}

.desktop-nav ul {
    display: flex;
    gap: 2rem;
}

.desktop-nav a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.desktop-nav a:hover {
    color: var(--brand-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-only {
    display: none;
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.mobile-nav-content nav ul {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.mobile-nav-content nav a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Footer */
.main-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-desc {
    font-size: 0.9rem;
    margin-top: 1rem;
    max-width: 300px;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-icons a {
    color: var(--text-secondary);
}

.social-icons a:hover {
    color: var(--brand-primary);
}

.footer-links h4,
.footer-contact h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--brand-primary);
}

.footer-contact li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bottom-container p {
    margin: 0;
    font-size: 0.85rem;
}

.legal-links a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 1.5rem;
}

/* --------------------------------------------------------------------------
   5. PAGES - HOME (index.php)
   -------------------------------------------------------------------------- */
main {
    margin-top: 70px;
}

/* Hero Section Slider Mode */
.hero-slider-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 70px);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Slide Gradient Overlay to ensure text readability globally */
.hero-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--bg-color) 10%, transparent 100%);
    opacity: 0.9;
    z-index: -1;
}

/* Ensure content sits above slides */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 4rem 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-heading {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
}

.hero-subtext {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 15;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--glass-border);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.slider-dot.active {
    background: var(--brand-primary);
    transform: scale(1.3);
}

/* Stats */
.stats-section {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-alt);
    padding: 3rem 0;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.stat-box h3 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    color: var(--brand-primary);
}

.stat-box p {
    margin: 0;
    font-weight: 500;
}

/* Section Headers */
.section-header {
    margin-bottom: 4rem;
    max-width: 700px;
}

.section-header h2 {
    font-size: 3rem;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: 100%;
}

.flex-header p {
    margin: 0;
}

/* Cards Grid */
.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.info-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-medium);
    display: block;
    color: inherit;
}

.info-card:hover {
    transform: translateY(-10px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.learn-more {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--brand-primary);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.news-card {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-medium);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.news-card-content {
    padding: 2rem;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.news-category {
    font-weight: 600;
    color: var(--brand-primary);
}

.news-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.news-title a {
    color: var(--text-primary);
}

.news-title a:hover {
    color: var(--brand-primary);
}

.read-more {
    font-weight: 600;
    font-size: 0.95rem;
}

/* CTA */
.cta-box {
    background: var(--gradient-brand);
    border-radius: var(--radius-lg);
    padding: 4rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cta-box h2 {
    color: #fff;
    font-size: 2.5rem;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.cta-box .btn-primary {
    background: #fff;
    color: var(--brand-primary) !important;
}

.cta-box .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Standard Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    transition: border var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Page Header (Inner Pages) */
.page-header {
    padding: 8rem 0 4rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* Beautiful Image Background Overrides for Page Headers */
.page-header-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.page-header-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient overlay to ensure text is perfectly readable */
    background: linear-gradient(to bottom, var(--bg-color) 0%, rgba(var(--bg-color), 0.8) 50%, var(--bg-color) 100%);
    z-index: -1;
}

.page-header-bg .container {
    position: relative;
    z-index: 5;
}

.page-header h1 {
    font-size: 3.5rem;
}

/* Content sections */
.content-wrapper {
    max-width: 800px;
}

/* Animations Layer */
.animate-on-load {
    animation: fadeInUp 0.8s ease backwards;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

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

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

/* --------------------------------------------------------------------------
   6. RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .desktop-nav {
        display: none;
    }

    .mobile-only {
        display: flex;
    }

    .hero-heading {
        font-size: 3.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .service-cards-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .hero-heading {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .section-header h2,
    .page-header h1 {
        font-size: 2.2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .service-cards-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .bottom-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}