/* Custom Styles for Ademola A. Website */

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Main content smooth transitions for SPA navigation */
main {
    transition: opacity 0.15s ease;
    min-height: calc(100vh - 64px);
}

/* SPA Loader styles */
#spa-loader {
    pointer-events: none;
}

/* Font-display swap - text remains visible while fonts load */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Inter Regular'), local('Inter-Regular'), url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2) format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local('Poppins Bold'), local('Poppins-Bold'), url(https://fonts.gstatic.com/s/poppins/v15/pxiKyp0ihIEF2isQFjxG.woff2) format('woff2');
}

/* 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;
    }
    html {
        scroll-behavior: auto;
    }
}

/* CSS Variables for Theme Management */
:root {
    --primary: #328990;
    --primary-dark: #266b73;
    --secondary: #3A65D3;
    --secondary-light: #5a7fe0;
    --accent: #328990;
    --dark: #1e293b;
    --light: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-light: rgba(50, 137, 144, 0.1);
    --shadow-medium: rgba(50, 137, 144, 0.2);
    --shadow-dark: rgba(50, 137, 144, 0.3);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary: #328990;
    --primary-dark: #40a8b3;
    --secondary: #3A65D3;
    --secondary-light: #6b82dc;
    --accent: #328990;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --bg-primary: #1e293b;
    --bg-secondary: #334155;
    --border-color: #475569;
    --shadow-light: rgba(50, 137, 144, 0.15);
    --shadow-medium: rgba(50, 137, 144, 0.25);
    --shadow-dark: rgba(50, 137, 144, 0.4);
}

/* Responsive Design Enhancements */

/* Mobile-first responsive utilities */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .mobile-menu-full {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 40;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .md-grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .lg-grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch-friendly targets for mobile */
@media (hover: none) {
    button, a, .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }
    
    .nav-mobile {
        display: block;
    }
    
    .mobile-menu-item {
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
        transition: background-color 0.3s ease;
    }
    
    .mobile-menu-item:hover {
        background-color: #f3f4f6;
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.75rem; }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Navigation active state */
.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

#mobile-menu.show {
    opacity: 1;
    transform: translateY(0);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--shadow-dark);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(58, 101, 211, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(58, 101, 211, 0.4);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle .sun-icon {
    transform: rotate(0deg);
}

.theme-toggle .moon-icon {
    transform: rotate(-180deg);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

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

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--primary-dark));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Fade in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Testimonial card styles */
.testimonial-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Dark mode testimonial card overrides - maintain colorful backgrounds with good contrast */
[data-theme="dark"] .testimonial-card {
    /* Keep the original gradient backgrounds unchanged */
}

[data-theme="dark"] .testimonial-card .text-gray-700 {
    color: #1a202c !important; /* Dark text for better contrast on colored backgrounds */
}

[data-theme="dark"] .testimonial-card .text-gray-600 {
    color: #2d3748 !important; /* Dark text for better contrast on colored backgrounds */
}

[data-theme="dark"] .testimonial-card .text-sm {
    color: #4a5568 !important; /* Dark text for smaller elements */
}

[data-theme="dark"] .testimonial-card .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.5) !important;
}

[data-theme="dark"] .testimonial-card .border-green-200 {
    border-color: rgba(34, 197, 94, 0.5) !important;
}

/* Form styles */
.form-input {
    transition: all 0.3s ease;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(50, 137, 144, 0.1);
}

/* Form labels for better contrast */
.form-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Textarea styling for consistency */
textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

/* Theme-aware form labels */
[data-theme="dark"] .text-gray-700 {
    color: var(--text-primary) !important;
}

/* Form select styling */
select.form-input {
    cursor: pointer;
}

/* Form checkbox and radio styling */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

/* Success and Error Messages */
.success-message {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin: 16px 0;
    display: none;
    animation: slideIn 0.5s ease;
}

.error-message {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin: 16px 0;
    display: none;
    animation: slideIn 0.5s ease;
}

/* Theme-aware Navigation */
.nav-scrolled {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-light);
}

/* Mobile Navigation Theme */
.mobile-menu-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
}

.mobile-menu-item {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* Theme-aware Progress Bars */
.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 1s ease;
}

/* Theme-aware Cards */
.card-hover,
.testimonial-card,
.portfolio-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card-hover:hover,
.testimonial-card:hover,
.portfolio-item:hover {
    box-shadow: 0 20px 40px var(--shadow-medium);
}

/* Dark Mode Specific Adjustments */
[data-theme="dark"] .gradient-to-br {
    background: linear-gradient(to bottom right, var(--bg-secondary), var(--bg-primary));
}

[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary);
}

[data-theme="dark"] .text-gray-700 {
    color: var(--text-primary);
}

/* Body Theme Application */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme-aware sections and backgrounds */
.bg-white {
    background-color: var(--bg-primary) !important;
}

.bg-gray-50 {
    background-color: var(--bg-secondary) !important;
}

.text-gray-600 {
    color: var(--text-secondary) !important;
}

.text-gray-700 {
    color: var(--text-primary) !important;
}

/* Theme-aware navigation */
nav {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
}

/* Smooth Theme Transitions - applied to specific elements only */
body, nav, .card-hover, .testimonial-card, .portfolio-item, .form-input {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Portfolio grid styles */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(30, 64, 175, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* Filter Button Active State */
.filter-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-btn {
    transition: all 0.3s ease;
}

/* Service card icons */
.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: rotate(10deg) scale(1.1);
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

/* Stats counter animation */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: #2563eb;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* Selection styles */
::selection {
    background: var(--primary);
    color: white;
}

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

/* Tool icons - dark monochrome style (only targets .tool-icon class) */
.tool-icon img {
    filter: grayscale(100%);
    opacity: 0.85;
}

/* Dark mode - invert for visibility */
[data-theme="dark"] .tool-icon img {
    filter: invert(1) grayscale(100%) brightness(1.2);
    opacity: 1;
}

/* Alert Banner - React Toastify Style */
.alert-banner {
    position: fixed;
    top: 5rem;
    right: 20px;
    max-width: 400px;
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

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

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

.alert-banner.hidden {
    display: none;
}

.alert-banner.success {
    background: #328990;
    color: white;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.alert-banner.error {
    background: #ef4444;
    color: white;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

/* Dark mode adjustments */
[data-theme="dark"] .alert-banner.success {
    background: #328990;
    box-shadow: 0 4px 12px rgba(50, 137, 144, 0.3);
}

[data-theme="dark"] .alert-banner.error {
    background: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.alert-banner button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    margin-top: 2px;
}

.alert-banner button:hover {
    opacity: 1;
}

.alert-banner-content {
    flex: 1;
}

.alert-banner-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    letter-spacing: -0.3px;
}

.alert-banner-message {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.4;
}

/* Loading state */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}