/* ==========================================================================
   KRALREI MAIN PORTAL & LANDING PAGE STYLESHEET (BOOTSTRAP 5 ENHANCED)
   Domain: kralrei.net
   Theme: High-Performance Motorsport, Dark Carbon Fiber & Neon Telemetry
   ========================================================================== */

:root {
    --bg-asphalt: #0b0c10;
    --bg-carbon: #14171d;
    --bg-carbon-card: #1f242e;
    --red-rally: #ff2e3b;
    --red-glow: rgba(255, 46, 59, 0.45);
    --orange-telemetry: #ff6b00;
    --orange-glow: rgba(255, 107, 0, 0.4);
    --cyan-neon: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.4);
    --yellow-sport: #eab308;
    --green-status: #22c55e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Barlow Condensed', sans-serif;
    --font-digital: 'Orbitron', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

/* Base Body Styling */
body {
    font-family: var(--font-body);
    background-color: var(--bg-asphalt);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Carbon Texture */
.carbon-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 4px 4px;
    background-image: 
        linear-gradient(45deg, rgba(0, 0, 0, 0.3) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3)),
        linear-gradient(45deg, rgba(0, 0, 0, 0.3) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3));
    background-position: 0 0, 2px 2px;
    z-index: -2;
    pointer-events: none;
    opacity: 0.85;
}

.speed-streaks {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 150%;
    height: 150%;
    background-image: repeating-linear-gradient(135deg, transparent, transparent 180px, rgba(255, 46, 59, 0.02) 180px, rgba(255, 46, 59, 0.02) 200px);
    z-index: -1;
    pointer-events: none;
}

/* Navbar Custom Styling */
.bg-dark-carbon {
    background-color: rgba(20, 23, 29, 0.92) !important;
    backdrop-filter: blur(15px);
}

.bg-dark-glass {
    background: rgba(15, 18, 24, 0.85) !important;
    backdrop-filter: blur(12px);
}

/* Custom Compact Corner Caption for Carousel */
.carousel-caption-left {
    position: absolute;
    bottom: 24px !important;
    left: 28px !important;
    right: auto !important;
    max-width: 400px;
    padding: 14px 18px !important;
    border-radius: 10px;
    background: rgba(15, 18, 24, 0.85) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left !important;
    z-index: 10;
}

.carousel-caption-left .badge {
    font-size: 0.65rem !important;
    letter-spacing: 1px;
    padding: 3px 8px !important;
}

.carousel-caption-left h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem !important;
    font-weight: 800;
    margin-bottom: 4px !important;
    line-height: 1.2;
    color: #ffffff;
}

.carousel-caption-left p {
    font-size: 0.78rem !important;
    line-height: 1.35;
    color: #94a3b8;
    margin-bottom: 0 !important;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.brand-title .highlight {
    color: var(--orange-telemetry);
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted) !important;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff !important;
}

.btn-rally {
    background: linear-gradient(135deg, var(--red-rally), var(--orange-telemetry));
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    box-shadow: 0 0 15px var(--red-glow);
    transition: all 0.3s;
}

.btn-rally:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--red-glow);
}

/* Typography & Headings */
h1, h2, h3, h4, .font-heading {
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.font-digital {
    font-family: var(--font-digital);
}

/* Custom Card Classes */
.card-carbon {
    background: var(--bg-carbon);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
}

.card-carbon-top-red {
    border-top: 4px solid var(--red-rally) !important;
}

.card-carbon-left-red {
    border-left: 5px solid var(--red-rally) !important;
}

/* Feature Box Custom Card */
.feature-card-item {
    background: rgba(15, 18, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    transition: all 0.3s ease;
}

.feature-card-item:hover {
    border-color: rgba(255, 46, 59, 0.4);
    background: rgba(255, 46, 59, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.feature-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 46, 59, 0.12);
    border: 1px solid rgba(255, 46, 59, 0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-rally);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-card-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1px;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 2px;
    line-height: 1.2;
}

.feature-card-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0;
    line-height: 1.35;
}

/* App Card Interactive Styling */
.app-card {
    background: var(--bg-carbon);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px 24px;
    text-decoration: none;
    color: white;
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-color, var(--red-rally));
    transition: height 0.3s;
}

.app-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color, var(--red-rally));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px var(--accent-glow, var(--red-glow));
    background: var(--bg-carbon-card);
    color: white;
}

.app-card:hover::before {
    height: 8px;
}

.app-icon-wrapper {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent-color, var(--red-rally));
    margin-bottom: 20px;
    transition: all 0.3s;
}

.app-card:hover .app-icon-wrapper {
    background: var(--accent-color, var(--red-rally));
    color: white;
    box-shadow: 0 0 20px var(--accent-glow, var(--red-glow));
}

.app-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.app-action-link {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color, var(--red-rally));
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
}

.app-card:hover .app-action-link {
    gap: 14px;
}

/* Footer Custom Styling */
.footer-dark {
    background: var(--bg-carbon);
    border-top: 1px solid var(--glass-border);
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: scale(1.05);
}

/* ==========================================================================
   LIGHT THEME OVERRIDES
   ========================================================================== */
[data-theme="light"] {
    --bg-asphalt: #f8fafc;
    --bg-carbon: #ffffff;
    --bg-carbon-card: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-border: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] body {
    background-color: var(--bg-asphalt);
    color: var(--text-main);
}

[data-theme="light"] .carbon-bg {
    opacity: 0.15;
}

[data-theme="light"] .bg-dark-carbon {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .bg-dark-glass {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .nav-link {
    color: #475569 !important;
}

[data-theme="light"] .nav-link:hover, 
[data-theme="light"] .nav-link.active {
    color: #0f172a !important;
}

[data-theme="light"] .text-white {
    color: #0f172a !important;
}

[data-theme="light"] .text-secondary {
    color: #475569 !important;
}

[data-theme="light"] .text-light {
    color: #1e293b !important;
}

[data-theme="light"] .card-carbon {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .feature-card-item {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .feature-card-item:hover {
    background: #ffffff;
    border-color: rgba(255, 46, 59, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .feature-card-title {
    color: #0f172a;
}

[data-theme="light"] .feature-card-desc {
    color: #475569;
}

[data-theme="light"] .app-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .app-card:hover {
    background: #f8fafc;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .app-icon-wrapper {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .footer-dark {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #0f172a;
    border: 1px solid rgba(0, 0, 0, 0.15);
}
