/* ========================================
   Matielo Consultoria Financeira - Custom Styles
   ======================================== */

/* Root Variables */
:root {
    --primary: #1e3a8a;
    --primary-dark: #1e293b;
    --primary-light: #3b82f6;
    --accent: #60a5fa;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
}

/* ========================================
   Global Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

/* ========================================
   Custom Animations
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animate on scroll class */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    animation: fadeInUp 0.8s ease-out;
}

/* ========================================
   Custom Components
   ======================================== */

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.15);
}

/* Button Styles */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 58, 138, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    border: 2px solid var(--primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

/* ========================================
   Page Loading Animation
   ======================================== */

body:not(.loaded) {
    overflow: hidden;
}

body.loaded {
    animation: fadeIn 0.5s ease-in;
}

/* ========================================
   Header Enhancements
   ======================================== */

header {
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* ========================================
   Hero Section Enhancements
   ======================================== */

.hero-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary-light) 100%);
}

/* ========================================
   Form Enhancements
   ======================================== */

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

/* ========================================
   Service Cards
   ======================================== */

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.05), transparent);
    transition: left 0.5s ease;
}

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

/* ========================================
   Testimonial Cards
   ======================================== */

.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Blog Post Cards
   ======================================== */

.blog-card {
    transition: all 0.3s ease;
}

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

.blog-card img {
    transition: all 0.3s ease;
}

.blog-card:hover img {
    transform: scale(1.05);
}

/* ========================================
   Stats Counter Animation
   ======================================== */

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

/* ========================================
   Footer Styles
   ======================================== */

footer a:hover {
    color: var(--accent);
}

/* ========================================
   Responsive Utilities
   ======================================== */

@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
}

/* ========================================
   Scroll Progress Bar (Optional)
   ======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ========================================
   Selection Colors
   ======================================== */

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

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* ========================================
   Scrollbar Styles
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========================================
   Loading Spinner
   ======================================== */

.spinner {
    border: 3px solid rgba(30, 58, 138, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   Utility Classes
   ======================================== */

.text-balance {
    text-wrap: balance;
}

.shadow-soft {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.shadow-primary {
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.15);
}

.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    header,
    footer,
    .no-print {
        display: none;
    }
    
    body {
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

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

.skip-to-content:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ========================================
   Performance Optimizations
   ======================================== */

img {
    max-width: 100%;
    height: auto;
}

video {
    max-width: 100%;
    height: auto;
}

/* Reduce motion for users who prefer it */
@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;
    }
}