/* Main CSS file - Combined and optimized styles */

/* CSS Variables and Theme Configuration */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #000000;
    --text-secondary: #666666;
    --primary-yellow: #FFE800;
    --primary-gray: #717B7B;
    --success-green: #52B007;
    --error-red: #CA190D;
    --border-radius: 10px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --section-spacing: 5rem;
    --button-text: #000000;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --shadow-sm: 0 2px 4px rgba(255,255,255,0.1);
    --shadow-md: 0 4px 6px rgba(255,255,255,0.1);
    --button-text: #000000;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

main {
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

/* Header styles */
header {
    background: var(--bg-primary);
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo img {
    height: 40px;
    width: auto;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-yellow);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-yellow);
}

nav ul li a:hover::after {
    transform: scaleX(1);
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-flags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-flag-btn {
    background: none;
    border: 2px solid transparent;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    opacity: 0.7;
    min-width: 50px;
    height: 50px;
}

.lang-flag-btn i {
    font-size: 2.5rem;
    line-height: 1;
    display: block;
}

/* Flag icon styles */
.fi {
    width: 2.5rem !important;
    height: 2.5rem !important;
    display: block;
    border-radius: 4px;
}

.fi-pt, .fi-gb {
    width: 2.5rem;
    height: 2.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.lang-flag-btn:hover {
    opacity: 1;
    background-color: rgba(255, 232, 0, 0.15);
    transform: scale(1.15);
}

.lang-flag-btn.active {
    opacity: 1;
    background-color: rgba(255, 232, 0, 0.25);
    border: 2px solid var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 232, 0, 0.1);
}

.lang-flag-btn.active:hover {
    background-color: rgba(255, 232, 0, 0.3);
}

.language-label {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Theme and Language Container */
.theme-language-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-label {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

#theme-select {
    padding: 0.5rem;
    border: 2px solid var(--primary-yellow);
    border-radius: 4px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    min-width: 120px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#theme-select:hover,
#theme-select:focus {
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 2px rgba(255, 232, 0, 0.2);
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.theme-switch {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
}

.theme-switch-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    height: 30px;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-yellow);
    border-radius: 30px;
    padding: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-switch-label i {
    font-size: 14px;
    transition: all 0.3s ease;
}

.theme-switch-label .fa-sun {
    color: #FFE800;
}

.theme-switch-label .fa-moon {
    color: #717B7B;
}

.switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: var(--primary-yellow);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.theme-switch:checked + .theme-switch-label .switch-handle {
    transform: translateX(30px);
}

.theme-switch:focus + .theme-switch-label {
    box-shadow: 0 0 0 2px rgba(255, 232, 0, 0.2);
}

.theme-switch:checked + .theme-switch-label {
    background: #2d2d2d;
}

.theme-switch:checked + .theme-switch-label .fa-sun {
    color: #717B7B;
}

.theme-switch:checked + .theme-switch-label .fa-moon {
    color: #FFE800;
}

/* Theme switch hover effect */
.theme-switch-label:hover {
    transform: scale(1.05);
}

/* Theme switch animation for handle */
@keyframes switchBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9); }
}

.switch-handle {
    animation: switchBounce 0.3s ease;
}

/* Dark theme adjustments for theme switch */
[data-theme="dark"] .theme-switch-label {
    background: #2d2d2d;
    border-color: var(--primary-yellow);
}

/* Buttons */
.btn, button[type="submit"], .submit-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    background-color: var(--primary-yellow);
    color: var(--button-text);
}

.btn:hover, button[type="submit"]:hover, .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 0.9;
}

/* Containers and Sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --section-spacing: 3rem;
    }
    
    .header-container {
        flex-direction: column;
        padding: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1rem;
    }
    
    .features-grid,
    .screenshot-gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--text-primary);
    transition: transform 0.3s ease;
}

.hamburger::before { transform: translateY(-8px); }
.hamburger::after { transform: translateY(8px); }

.mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .theme-language-container {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-primary);
        padding: 1rem;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }

    .theme-language-container.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    #nav-placeholder {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-primary);
        padding: 1rem;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }

    #nav-placeholder.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    nav ul li a {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* Utility Classes */
.success { color: var(--success-green); }
.error { color: var(--error-red); }
.text-center { text-align: center; }
.mt-5 { margin-top: 5rem; }
.mb-5 { margin-bottom: 5rem; }

/* Component Styles */

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding-top: 120px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.feature-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-icon {
    color: var(--primary-yellow);
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Screenshots Section */
.screenshots-section {
    padding: 80px 0;
    background-color: var(--bg-primary);
}

#screenshotCarousel {
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--shadow-md);
}

/* Image Loading Optimizations */
.app-screenshots picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-screenshots picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-screenshots picture.active,
.app-screenshots picture.active img {
    opacity: 1;
}

/* Image loading states */
.screenshot {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screenshot.loaded {
    opacity: 1;
}

/* Prevent layout shift */
.phone-mockup {
    aspect-ratio: 300 / 600;
    max-width: 300px;
    width: 100%;
    height: auto;
}

.screen-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

/* Progressive loading animation */
@keyframes imageLoadingPulse {
    0% { background-color: var(--bg-primary); }
    50% { background-color: var(--bg-primary); }
    100% { background-color: var(--bg-primary); }
}

.image-loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: imageLoadingPulse 1.5s ease infinite;
    border-radius: var(--border-radius);
}

/* Responsive images */
@media (max-width: 768px) {
    .phone-mockup {
        max-width: 250px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-screenshots picture,
    .app-screenshots picture img,
    .screenshot {
        transition: none;
    }
    
    .image-loading-placeholder {
        animation: none;
        background-color: var(--bg-primary);
    }
}

/* Support Section */
.support-section {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--text-secondary);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Form Validation Styles */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group label.required::after {
    content: '*';
    color: var(--error-red);
    margin-left: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--text-secondary);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--primary-yellow);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 232, 0, 0.2);
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: var(--error-red);
}

.form-group input.invalid:focus,
.form-group textarea.invalid:focus {
    box-shadow: 0 0 0 3px rgba(202, 25, 13, 0.2);
}

.error-message {
    display: block;
    font-size: 0.875rem;
    color: var(--error-red);
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

/* Form Response Message */
.response-message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.response-message.success {
    background-color: var(--success-green);
    color: white;
}

.response-message.error {
    background-color: var(--error-red);
    color: white;
}

/* Submit Button States */
.submit-btn {
    position: relative;
    overflow: hidden;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.submit-btn:active::after {
    width: 200%;
    height: 200%;
}

/* reCAPTCHA Container */
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .recaptcha-container {
        transform: scale(0.9);
        transform-origin: center;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .form-group input,
    .form-group textarea,
    .submit-btn,
    .error-message,
    .response-message {
        transition: none;
    }
}

/* FAQ Section */
.faq-section {
    padding-top: 120px;
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    min-height: 100vh;
}

.faq-item {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-yellow);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item h2 {
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-secondary);
}

/* Privacy, Terms & FAQ Pages */
.privacy-section,
.terms-section,
.faq-section {
    background-color: transparent;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

.privacy-content section,
.terms-content .card,
.faq-item {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 3rem;
    border-radius: var(--border-radius);
    box-shadow: none;
    border: none;
}

.privacy-content section {
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.privacy-content section:last-child {
    border-bottom: none;
}

.terms-content .card {
    margin-bottom: 0;
}

.terms-content .card-body {
    background-color: transparent;
    color: var(--text-primary);
    padding: 2rem 0;
    border-left: none;
}

.privacy-content h1,
.privacy-content h2,
.privacy-content h3,
.terms-content h1,
.terms-content h2,
.terms-content h3,
.faq-section h1,
.faq-section h2 {
    color: var(--text-primary);
}

.privacy-content p,
.privacy-content ul,
.privacy-content li,
.terms-content p,
.terms-content ul,
.terms-content li,
.faq-section p {
    color: var(--text-secondary);
}

/* Privacy & Terms theme adaptation */
.privacy-content section,
.terms-content section {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-yellow);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 3rem 0;
    border-top: 2px solid var(--primary-yellow);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary-yellow);
}

.footer-social a {
    color: var(--text-primary);
    margin: 0 0.5rem;
    transition: color 0.3s ease;
    font-size: 1.5rem;
}

.footer-social a:hover {
    color: var(--primary-yellow);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-secondary);
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in { animation: fadeIn 1s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.8s ease-out forwards; }
.animate-slide-up-delay { animation: slideUp 0.8s ease-out 0.2s forwards; }