/* =========================================
   DigiSoft TechSolutions - Custom Styles
   ========================================= */

/* CSS Variables - Professional Trust Color Scheme */
:root {
    /* Primary Colors - Deep Blue for Trust */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-subtle: #dbeafe;
    
    /* Secondary Colors */
    --secondary: #0f172a;
    --secondary-light: #1e293b;
    
    /* Accent Colors */
    --accent: #06b6d4;
    --accent-light: #67e8f9;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-dark: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* =========================================
   Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    line-height: 1.3;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   Bootstrap Overrides
   ========================================= */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    border-width: 2px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.btn-outline-light:hover {
    transform: translateY(-2px);
}

.btn-light {
    background: var(--white);
    color: var(--primary);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.btn-light:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.form-control, .form-select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* =========================================
   Navigation
   ========================================= */
#mainNav {
    padding: 1rem 0;
    transition: all var(--transition);
    background: transparent;
}

#mainNav.scrolled {
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
}

#mainNav.scrolled .nav-link {
    color: var(--gray-900) !important;
}

#mainNav.scrolled .nav-link:hover,
#mainNav.scrolled .nav-link.active {
    color: var(--primary) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white) !important;
    padding: 0;
}

.navbar-logo {
    height: 75px;
    width: auto;
    transition: all var(--transition);
}

#mainNav.scrolled .navbar-logo {
    height: 60px;
}

.navbar-brand i {
    color: var(--accent);
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* =========================================
   Hero Section
   ========================================= */
.hero-section {
    position: relative;
    min-height: 100vh;
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.7) 50%, rgba(15, 23, 42, 0.4) 100%);
    z-index: 1;
}

.hero-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    z-index: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 991.98px) {
    .hero-image {
        width: 100%;
    }
    
    .hero-overlay {
        background: rgba(15, 23, 42, 0.85);
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.counter {
    font-size: 2.5rem;
}

/* =========================================
   Tech Stack Section
   ========================================= */
.tech-stack-section {
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
}

.letter-spacing {
    letter-spacing: 0.1em;
}

.tech-logos {
    padding: 1rem 0;
}

.tech-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    color: var(--gray-400);
    transition: all var(--transition);
    cursor: default;
}

.tech-logo:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

.tech-logo i {
    font-size: 2rem;
}

.tech-logo span {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .hero-section .display-3 {
        font-size: 2.5rem;
    }
    
    .counter {
        font-size: 1.75rem;
    }
    
    .tech-logo {
        padding: 0.75rem 1rem;
    }
    
    .tech-logo i {
        font-size: 1.5rem;
    }
}

/* =========================================
   About Section
   ========================================= */
.about-image-wrapper {
    position: relative;
    padding: 2rem;
}

.about-image-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 2rem;
    bottom: 2rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    opacity: 0.1;
}

.about-image {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.about-stats {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 1.5rem;
}

.stats-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.feature-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =========================================
   Services Section
   ========================================= */
.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    border: 1px solid var(--gray-100);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-subtle);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--white);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left var(--transition-slow);
}

.service-card:hover .service-icon::before {
    left: 100%;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.4);
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* =========================================
   Portfolio Section
   ========================================= */
.portfolio-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.1);
}

.portfolio-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-content {
    padding: 1.5rem;
}

/* =========================================
   CTA Section
   ========================================= */
.cta-section {
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.15;
    animation: pulse 4s ease-in-out infinite;
}

.cta-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0.15;
    animation: pulse 4s ease-in-out infinite 2s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.15;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

/* =========================================
   Contact Section
   ========================================= */
.contact-info-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.contact-form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.contact-item {
    display: flex;
    align-items: flex-start;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-subtle);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-details {
    margin-left: 1rem;
}

.contact-details a {
    color: var(--gray-600);
    transition: color var(--transition-fast);
}

.contact-details a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: var(--gray-900);
}

.footer-brand {
    display: inline-block;
}

.footer-logo {
    height: 50px;
    width: auto;
    filter: brightness(1.1);
    transition: all var(--transition);
}

.footer-brand:hover .footer-logo {
    transform: scale(1.05);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    color: var(--gray-400);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.footer-contact a {
    color: var(--gray-400);
}

.footer-contact a:hover {
    color: var(--white);
}

.footer .social-link {
    background: var(--gray-800);
    color: var(--gray-400);
}

.footer .social-link:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-bottom-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .footer-bottom-links {
        justify-content: flex-end;
    }
}

.footer-bottom-links a {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.footer-bottom-links a:hover {
    color: var(--white);
}

/* =========================================
   Back to Top Button
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    color: var(--white);
    box-shadow: var(--shadow-xl);
}

/* =========================================
   Utility Classes
   ========================================= */
.py-6 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.z-1 {
    z-index: 1;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Gradient border effect for service cards */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    opacity: 0;
    transition: opacity var(--transition);
}

.service-card:hover::before {
    opacity: 1;
}

/* Portfolio image gradient overlay */
.portfolio-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
}

/* Badge shine effect */
.badge {
    position: relative;
    overflow: hidden;
}

.bg-primary-subtle.text-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 3s infinite;
}

/* Button glow effect */
.btn-primary:hover {
    box-shadow: 0 0 30px rgba(30, 64, 175, 0.5);
}

/* Stats counter glow */
.counter {
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

/* =========================================
   Loading Spinner
   ========================================= */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 991.98px) {
    #mainNav {
        background: var(--gray-900);
    }
    
    .navbar-collapse {
        padding: 1rem 0;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

@media (max-width: 767.98px) {
    .py-6 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .about-stats {
        position: relative;
        bottom: 0;
        right: 0;
        margin-top: 1rem;
    }
    
    .contact-info-card,
    .contact-form-card {
        padding: 1.5rem;
    }
}

/* =========================================
   Print Styles
   ========================================= */
@media print {
    .navbar,
    .back-to-top,
    .cta-section {
        display: none !important;
    }
    
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
}
