/* Custom CSS Styles */

/* CSS Variables for Dynamic Theming */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family-sans-serif: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.3s ease-in-out;
}

/* Base Styles */
body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: #333;
    scroll-behavior: smooth;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 100;
}

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

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
}

/* Navbar Customizations */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-logo {
    height: 40px;
    width: auto;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: var(--primary-color);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.hero-title {
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-arrow {
    animation: bounce 2s infinite;
    color: white;
    font-size: 1.5rem;
}

/* Section Styles */
.section-title {
    position: relative;
    margin-bottom: 1rem;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-subtitle {
    margin-bottom: 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

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

.featured-card {
    border-top: 3px solid var(--primary-color);
}

.blog-card {
    overflow: hidden;
}

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

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

.project-card {
    overflow: hidden;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

/* Skills Section */
.skills-grid {
    margin-bottom: 2rem;
}

.skill-category {
    margin-bottom: 2rem;
}

.skill-category-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.skill-item {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
}

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

.skill-icon {
    margin-bottom: 1rem;
}

.skill-progress {
    margin-bottom: 0.5rem;
}

.skill-progress .progress {
    height: 10px;
    border-radius: 5px;
}

/* Testimonials */
.testimonial-card {
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.testimonial-rating {
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: #1a1a1a !important;
    color: #fff;
}

.footer-title {
    color: #fff;
    margin-bottom: 1rem;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
}

.footer-text {
    color: #ccc;
    line-height: 1.6;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-link {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

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

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: var(--transition);
}

.back-to-top:hover {
    transform: translateY(-2px);
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-consent.show {
    transform: translateY(0);
}

/* WhatsApp Chat Button */
.whatsapp-chat {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 999;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Newsletter */
.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

/* Blog Styles */
.blog-post {
    margin-bottom: 2rem;
}

.post-meta-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
}

.post-categories a {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-meta {
    color: #6c757d;
    font-size: 0.9rem;
}

.ck-content {
    line-height: 1.8;
}

.ck-content h2, .ck-content h3, .ck-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.ck-content p {
    margin-bottom: 1.5rem;
}

.ck-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Comments */
.comment {
    margin-bottom: 1.5rem;
}

.comment .card {
    border-left: 3px solid var(--primary-color);
}

.reply {
    margin-left: 2rem;
    margin-top: 1rem;
}

/* Portfolio */
.portfolio-filters {
    margin-bottom: 2rem;
}

.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.project-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Search Results */
.search-form .form-control {
    border-radius: 0.375rem 0 0 0.375rem;
}

.search-form .btn {
    border-radius: 0 0.375rem 0.375rem 0;
}

.result-card mark {
    background-color: yellow;
    padding: 0 2px;
    border-radius: 2px;
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .skill-item {
        padding: 1rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .whatsapp-chat {
        bottom: 80px;
        right: 20px;
    }
    
    .whatsapp-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .back-to-top,
    .whatsapp-chat,
    .cookie-consent {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-outline-primary {
        border-width: 2px;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .form-control {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-arrow {
        animation: none;
    }
    
    .whatsapp-btn {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content styles */
.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;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}