/* Custom CSS for Flag & Torch LLC Website */

:root {
    --primary-color: #6b7c47;     /* Military olive green from logo shield */
    --secondary-color: #4a5233;   /* Darker green for accents */
    --accent-color: #f4e4c1;      /* Cream color from torch and text */
    --dark-color: #1e1e1e;        /* Logo background color */
    --light-color: #f8f6f2;       /* Light cream background */
    --text-muted: #5f5f56;        /* Muted text on light backgrounds (WCAG AA) */
    --text-muted-dark: rgba(244, 228, 193, 0.78); /* Muted text on dark backgrounds */
    --torch-flame: #f4e4c1;       /* Torch flame color */
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
    background-color: var(--dark-color);
    color: var(--accent-color);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(107, 124, 71, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(74, 82, 51, 0.1) 0%, transparent 50%),
        linear-gradient(45deg, transparent 30%, rgba(244, 228, 193, 0.02) 50%, transparent 70%);
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--primary-color) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--primary-color) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.03;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-image {
    animation: float 6s ease-in-out infinite;
    position: relative;
}

.hero-image img {
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
    transition: all 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.02);
    filter: drop-shadow(0 20px 40px rgba(107, 124, 71, 0.3));
}

.hero-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(107, 124, 71, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse-glow 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

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

/* Navigation */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background-color: var(--dark-color) !important;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar:hover::after {
    opacity: 1;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color) !important;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    color: var(--accent-color) !important;
    position: relative;
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link:hover::before {
    width: 80%;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 50px;
    padding: 12px 30px;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(107, 124, 71, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(107, 124, 71, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    color: var(--accent-color);
}

.btn-light {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 228, 193, 0.3);
    background-color: var(--torch-flame);
    color: var(--dark-color);
}

.btn-outline-light {
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-outline-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 228, 193, 0.3);
    background-color: var(--accent-color);
    color: var(--dark-color);
}

/* Cards */
.card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 15px;
    background-color: var(--light-color);
    border: 1px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(107, 124, 71, 0.18) !important;
    border-color: var(--secondary-color);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-body {
    color: var(--dark-color);
    position: relative;
    z-index: 2;
}

.card-title {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.card:hover .card-title {
    color: var(--primary-color);
}

/* Sections */
section {
    position: relative;
}

section:not(.hero-section) {
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* Ensure headings have proper contrast on light backgrounds */
section:not(.hero-section):not(.bg-light) h1,
section:not(.hero-section):not(.bg-light) h2,
section:not(.hero-section):not(.bg-light) h3,
section:not(.hero-section):not(.bg-light) h4,
section:not(.hero-section):not(.bg-light) h5,
section:not(.hero-section):not(.bg-light) h6 {
    color: var(--dark-color);
    text-shadow: none;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    color: var(--accent-color);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Gradient text only for hero section on dark background */
.hero-section h1 {
    background: linear-gradient(135deg, var(--accent-color), rgba(244, 228, 193, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    position: relative;
    margin-bottom: 2rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.text-center h2::after {
    left: 50%;
    transform: translateX(-50%);
}

.display-4 {
    font-size: 3.5rem;
    font-weight: 800;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.lead {
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(244, 228, 193, 0.9);
}

.bg-light {
    background-color: #efe9d8 !important;
    color: var(--dark-color) !important;
}

.bg-light .card {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.bg-light h2,
.bg-light h3,
.bg-light h4,
.bg-light h5,
.bg-light h6 {
    color: var(--dark-color) !important;
}

.bg-light .lead {
    color: #44443e !important;
}

.bg-light .text-muted {
    color: var(--text-muted) !important;
}

/* Ensure text contrast on white backgrounds */
section:not(.bg-light) .lead {
    color: #55554e;
}

section:not(.bg-light) .text-muted {
    color: #5f5f56 !important;
}

/* Contact Section */
.contact-item {
    display: block;
    text-align: center;
    padding: 2rem 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    color: inherit;
}

.contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 124, 71, 0.05) 0%, rgba(74, 82, 51, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.contact-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(107, 124, 71, 0.15);
}

.contact-item:hover::before {
    opacity: 1;
}

.contact-item i {
    display: block;
    margin-bottom: 1rem;
    transition: all 0.4s ease;
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
}

.contact-item:hover i {
    color: var(--primary-color) !important;
    transform: scale(1.08);
}

.contact-item h5,
.contact-item p {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.contact-item:hover h5 {
    color: var(--primary-color);
}

.contact-link {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.contact-item:hover .contact-link {
    color: var(--primary-color);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--secondary-color) 100%);
    color: var(--accent-color);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(107, 124, 71, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(74, 82, 51, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

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

footer a {
    color: var(--accent-color);
    transition: all 0.3s ease;
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

footer a:hover::after {
    width: 100%;
}



/* App Showcase */
.app-showcase {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.app-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(107, 124, 71, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.app-showcase img {
    max-width: 100%;
    height: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.app-showcase img:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 32px rgba(107, 124, 71, 0.2);
}

/* App Image Enhancement */
.app-image {
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px;
    margin: 2rem;
    position: relative;
    overflow: hidden;
}

.app-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate-gradient 10s linear infinite;
}

@keyframes rotate-gradient {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.app-image i {
    color: var(--accent-color) !important;
    position: relative;
    z-index: 2;
}

/* Logo Container */
.logo-container {
    background-color: var(--dark-color);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* App Features List */
.features-list {
    list-style: none;
    padding-left: 0;
}

.features-list li {
    color: #55554e;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* App Actions */
.app-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.app-actions a:not(.btn) {
    color: var(--primary-color) !important;
    font-weight: 600;
    transition: color 0.3s ease;
}

.app-actions a:not(.btn):hover {
    color: var(--secondary-color) !important;
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--accent-color) !important;
}

.text-white {
    color: var(--accent-color) !important;
}

.text-success {
    color: var(--primary-color) !important;
}

/* Smooth Scrolling for Anchor Links */
html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 84px;
}

.navbar.scrolled {
    backdrop-filter: blur(12px);
    background-color: rgba(30, 30, 30, 0.96) !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active::before {
    width: 80%;
}

.footer-badge {
    height: 100px;
    width: auto;
}

.contact-link {
    overflow-wrap: anywhere;
    font-size: 0.92rem;
}

/* Contact Form */
.contact-item-button {
    background: none;
    border: none;
    width: 100%;
    font: inherit;
    cursor: pointer;
}

.contact-modal-content {
    background-color: var(--light-color);
    color: var(--dark-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    overflow: hidden;
}

.contact-form .form-control {
    border-radius: 12px;
    border: 1px solid #d8d2c0;
    padding: 0.75rem 1rem;
    background-color: #fffdf7;
    color: var(--dark-color);
}

.contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(107, 124, 71, 0.18);
    background-color: #ffffff;
}

.contact-form .form-control::placeholder {
    color: #9a978c;
}

.app-showcase img.app-icon {
    max-width: 280px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 6rem 0 2rem 0; /* Add top padding to clear navbar */
        min-height: calc(100vh - 80px); /* Adjust min-height to account for navbar */
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .app-image {
        margin: 1rem 0;
        padding: 2rem;
    }
    
    /* Ensure navbar doesn't cover content on mobile */
    .navbar {
        padding: 0.5rem 0;
    }
}

/* Animation Classes — visible by default; only hidden pre-animation when JS is available */
.fade-in, .slide-in-left, .slide-in-right, .scale-in {
    opacity: 1;
}

.js .fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.js .slide-in-left {
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.js .slide-in-right {
    opacity: 0;
    transform: translateX(32px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.js .scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

    .js .fade-in, .js .slide-in-left, .js .slide-in-right, .js .scale-in {
        opacity: 1;
        transform: none;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Utility Classes */
.text-accent {
    color: var(--accent-color) !important;
}

/* Text gradient - only use on dark backgrounds for contrast */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark background gradient text */
.hero-section .text-gradient {
    background: linear-gradient(135deg, var(--accent-color), rgba(244, 228, 193, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Safe gradient for light backgrounds */
.text-gradient-safe {
    background: linear-gradient(135deg, var(--secondary-color), var(--dark-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rounded-custom {
    border-radius: 20px;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(107, 124, 71, 0.1);
}

.shadow-custom-hover:hover {
    box-shadow: 0 20px 50px rgba(107, 124, 71, 0.25);
}

/* Interactive Elements */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(107, 124, 71, 0.3);
}

.interactive-card {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.interactive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(107, 124, 71, 0.1), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.interactive-card:hover::before {
    left: 100%;
}

/* Smooth Transitions for Interactive Elements */
a, button, .btn, .card, .nav-link, .navbar-brand,
.contact-item, .contact-item i, .app-showcase img, .hero-image img {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
} 