/* Modern Improvements for William Galindo's Website */

/* 1. Modern Color Scheme & Variables */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #fbbf24;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 2. Modern Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* Dark mode text color overrides */
[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --border-color: #374151;
}

/* Ensure text-muted works in both themes */
.text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Amiri', serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* 3. Modern Card Design */
.modern-card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* 4. Modern Button Styles */
.btn-modern {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-modern-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-modern-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 5. Modern Navigation */
.navbar-modern {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.navbar-modern .nav-link {
    position: relative;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-modern .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.navbar-modern .nav-link:hover::after,
.navbar-modern .nav-link.active::after {
    width: 100%;
}

/* 6. Modern Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

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

/* 7. Modern Grid Layout */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* 8. Modern Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* 9. Modern Form Styles */
.modern-form {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modern-form .form-control {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.modern-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 10. Modern Footer */
.footer-modern {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-modern .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    margin: 0 8px;
    transition: all 0.3s ease;
}

.footer-modern .social-icons a:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* 11. Modern Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.skill-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.skill-card .icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* 12. Modern Project Cards */
.project-card {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-card .card-body {
    padding: 1.5rem;
}

/* 13. Modern Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 14. Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

/* 15. Modern Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 60px;
    }
    
    .modern-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-modern {
        padding: 1rem 0;
    }
}

/* 16. Modern Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --border-color: #374151;
    }
    
    .modern-card {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .navbar-modern {
        background: rgba(17, 24, 39, 0.8);
        border-bottom-color: var(--border-color);
    }
}

/* 17. Modern Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 18. Modern Focus States */
.btn-modern:focus,
.nav-link:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 19. Modern Glassmorphism */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
}

/* 20. Modern Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 21. Modern Sleek Light Switch */
.theme-switch-wrapper {
    position: relative;
    display: inline-block;
}

.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.theme-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.theme-switch::after {
    content: '☀️';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 1;
    opacity: 1;
}

.theme-switch.dark::after {
    content: '🌙';
    left: auto;
    right: 8px;
    opacity: 1;
}

.theme-switch.dark::before {
    transform: translateX(30px);
    background: linear-gradient(135deg, #1e293b, #334155);
}

.theme-switch:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.theme-switch:active {
    transform: scale(0.95);
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Dark mode styles for the switch */
[data-theme="dark"] .theme-switch {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .theme-switch::before {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* Animation for the switch */
@keyframes switchGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
}

.theme-switch:hover {
    animation: switchGlow 2s ease-in-out infinite;
}
