/* TextBridge Website - Main Stylesheet */
/* Professional, modern, and accessible design */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #ff6b00;
    --secondary-color: #e65100;
    --accent-color: #ff8533;
    --text-color: #1d1d1f;
    --text-light: #6e6e73;
    --bg-color: #ffffff;
    --bg-alt: #f5f5f7;
    --border-color: #d2d2d7;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ff8533;
        --secondary-color: #ff6b00;
        --accent-color: #ff9d5c;
        --text-color: #f5f5f7;
        --text-light: #a1a1a6;
        --bg-color: #000000;
        --bg-alt: #1d1d1f;
        --border-color: #424245;
        --shadow: 0 1px 3px 0 rgba(255, 255, 255, 0.1), 0 1px 2px 0 rgba(255, 255, 255, 0.06);
        --shadow-lg: 0 10px 15px -3px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05);
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', sans-serif;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    opacity: 0;
    animation: pageLoad 0.6s ease-out forwards;
}

/* Page Load Animation */
@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Skip to main content for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Header and Navigation */
header {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-img {
    height: 40px;
    margin-right: 0.5rem;
}

/* Logo image switching for dark/light mode */
.logo-img-light {
    display: inline;
}

.logo-img-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .logo-img-light {
        display: none;
    }
    
    .logo-img-dark {
        display: inline;
    }
}

/* TextBridge text styling */
.logo-text {
    color: var(--text-color);
}

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

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

nav a:hover,
nav a:focus {
    color: var(--primary-color);
    outline: none;
}

nav a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(180deg, rgba(255, 107, 0, 0.1) 0%, rgba(230, 81, 0, 0.05) 100%);
    color: var(--text-color);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.022em;
    color: var(--text-light);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 980px;
    font-size: 17px;
    line-height: 1.17648;
    font-weight: 400;
    letter-spacing: -0.022em;
    min-width: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Add spacing between inline buttons */
.btn + .btn {
    margin-left: 1rem;
}

.btn:hover,
.btn:focus {
    background: var(--secondary-color);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--secondary-color);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--primary-color);
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: white;
    color: var(--primary-color);
}

/* Section Styles */
.section {
    padding: 4rem 2rem;
}

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

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.125rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.section-subtitle.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* When there are exactly 3 items, they should be in a row */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Card Component */
.card {
    background: var(--bg-color);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease-out;
    opacity: 0;
    transform: translateY(30px);
}

.card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

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

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Team Member Card */
.team-member {
    text-align: center;
}

.team-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.team-member h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.team-role {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.team-bio {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background 0.3s ease;
}

.social-link:hover,
.social-link:focus {
    background: var(--secondary-color);
}

/* Features Section */
.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Contact Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.form-error-message {
    background: var(--error-color);
    color: white;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Timeline (for History page) */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-item.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 12px;
    width: 2px;
    height: calc(100% + 2rem);
    background: var(--border-color);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--bg-alt);
    color: var(--text-color);
    padding: 3rem 2rem 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.footer-section p,
.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover,
.footer-section a:focus {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-links {
    list-style: none;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        box-shadow: var(--shadow);
        display: none;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }

    nav a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    /* Mobile button spacing in hero section */
    .hero .btn {
        display: block;
        margin: 0.75rem auto;
        max-width: 280px;
    }
    
    /* Remove horizontal spacing on mobile when buttons stack */
    .btn + .btn {
        margin-left: 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }

    .section {
        padding: 2rem 1rem;
    }
}

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

/* Smooth Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

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

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

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

/* Staggered Animation for Grid Items */
.grid .card:nth-child(1) {
    transition-delay: 0.1s;
}

.grid .card:nth-child(2) {
    transition-delay: 0.2s;
}

.grid .card:nth-child(3) {
    transition-delay: 0.3s;
}

.grid .card:nth-child(4) {
    transition-delay: 0.4s;
}

/* Reduced Motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    body {
        opacity: 1;
        animation: none;
    }
    
    .hero h1,
    .hero p {
        opacity: 1;
        transform: none;
        animation: none;
    }
    
    .card,
    .section-title,
    .section-subtitle,
    .timeline-item,
    .fade-in,
    .slide-in-left,
    .slide-in-right {
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    .menu-toggle,
    .btn {
        display: none;
    }

    body {
        color: black;
    }
}
