@import 'theme.css';

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalPopOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Scroll Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transform: translateY(50px);
    will-change: opacity, transform;
}

.animate-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Global Background Texture --- */
body {
    background-color: var(--bg-body);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
}

/* --- Layout --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Slogan Badge --- */
.tagline-badge {
    display: inline-block;
    font-family: 'Courier New', monospace; /* Monospace for tech feel */
    font-size: 0.8rem;
    color: var(--color-primary);
    border: 1px solid rgba(0, 255, 157, 0.3);
    background: rgba(0, 255, 157, 0.05);
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.1);
}

.section {
    padding: 100px 0;
}

/* --- Components: Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--text-dark);
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.5);
}

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

.btn-outline:hover {
    background: rgba(0, 255, 157, 0.1);
}

/* --- Components: Navbar --- */
.navbar {
    height: var(--nav-height);
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: var(--border-subtle);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--color-primary);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* --- Components: Footer --- */
.footer {
    background: var(--bg-surface);
    padding: 60px 0 30px;
    border-top: var(--border-subtle);
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--text-main);
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-muted);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Components: Cards --- */
.card {
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 30px;
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    border-color: rgba(0, 255, 157, 0.3);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-body);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: var(--border-subtle);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .mobile-toggle {
        display: block;
    }
}

/* --- Downloads Page Specifics --- */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box; /* Crucial for padding */
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    width: 100%;
}

.device-card {
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.device-card img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Modal Responsive Fixes & Animation */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex; /* Changed from just display: flex to using class */
    opacity: 1;
}

.modal-overlay.closing {
    opacity: 0;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    position: relative;
    border: 1px solid var(--color-primary);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-overlay.closing .modal-content {
    transform: scale(0.9);
}

.build-card {
    background: var(--bg-surface);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border-subtle);
    word-break: break-word; /* Prevent text overflow */
}

.download-btn-full {
    width: 100%;
    text-align: center;
    display: block;
    padding: 12px;
    font-size: 0.9rem;
    text-decoration: none;
    color: #000;
    box-sizing: border-box;
    margin-top: 10px;
    border-radius: 50px;
}

/* Modern Modal Tabs */
.modal-tabs {
    display: flex;
    background: var(--bg-surface);
    padding: 4px;
    border-radius: 50px;
    margin-bottom: 24px;
    position: relative;
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 255, 157, 0.3);
}

.tab-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

/* --- Team Page Hierarchy --- */
.team-section-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.team-section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    margin: 15px auto 0;
    border-radius: 2px;
}

.team-avatar-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    z-index: 1;
}

.team-avatar-lg::before {
    content: '';
    position: absolute;
    top: -5px; bottom: -5px; left: -5px; right: -5px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    filter: blur(10px);
}

.team-avatar-md {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: var(--bg-surface);
    border: 2px solid var(--color-secondary);
}

.team-avatar-sm {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--text-muted);
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-lead { background: rgba(255, 215, 0, 0.2); color: #ffd700; border: 1px solid #ffd700; }
.role-core { background: rgba(0, 194, 255, 0.2); color: var(--color-secondary); border: 1px solid var(--color-secondary); }
.role-design { background: rgba(255, 0, 221, 0.2); color: #ff00dd; border: 1px solid #ff00dd; }
.role-contrib { background: rgba(0, 255, 157, 0.2); color: var(--color-primary); border: 1px solid var(--color-primary); }
.role-maintainer { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); border: 1px solid var(--text-muted); }

/* Card Variations */
.card-lead {
    background: linear-gradient(180deg, rgba(20,20,20,1) 0%, rgba(10,10,10,1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 40px rgba(0,0,0,0.5), 0 0 20px rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

.social-links a {
    transition: transform 0.2s;
    display: inline-block;
}
.social-links a:hover {
    transform: translateY(-3px);
}