@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== THEME VARIABLES ===== */

/* Dark Theme (default) */
.theme-dark {
    --bg-body: #0b1120;
    --bg-surface: rgba(15, 23, 42, 0.85);
    --bg-card: rgba(30, 41, 66, 0.7);
    --bg-card-hover: rgba(40, 54, 85, 0.85);
    --bg-header: rgba(15, 23, 42, 0.92);
    --bg-footer: rgba(10, 16, 30, 0.95);
    --bg-input: rgba(30, 41, 66, 0.6);
    --bg-hero-overlay: linear-gradient(135deg, rgba(11, 17, 32, 0.88) 0%, rgba(47, 95, 140, 0.55) 100%);
    --border-color: rgba(79, 107, 135, 0.18);
    --border-card: rgba(79, 107, 135, 0.24);
    --text-heading: #e2e8f0;
    --text-body: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --accent: #3b6ea5;
    --accent-hover: #4f7fb0;
    --accent-glow: rgba(59, 110, 165, 0.25);
    --gradient-accent: linear-gradient(135deg, #2f5f8c 0%, #4b5a72 100%);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-header: 0 2px 20px rgba(0, 0, 0, 0.3);
    --shadow-btn: 0 4px 16px rgba(47, 95, 140, 0.35);
    --shadow-btn-hover: 0 8px 28px rgba(47, 95, 140, 0.5);
    --icon-bg: rgba(47, 95, 140, 0.14);
    --icon-border: rgba(47, 95, 140, 0.25);
    --scrollbar-thumb: #334155;
    --scrollbar-track: #0f172a;
    --toggler-filter: invert(1);
}

/* Light Theme */
.theme-light {
    --bg-body: #f0f4f8;
    --bg-surface: rgba(255, 255, 255, 0.9);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-footer: #1e293b;
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-hero-overlay: linear-gradient(135deg, rgba(47, 95, 140, 0.85) 0%, rgba(90, 106, 130, 0.82) 100%);
    --border-color: rgba(64, 89, 110, 0.12);
    --border-card: rgba(64, 89, 110, 0.18);
    --text-heading: #0f172a;
    --text-body: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --accent: #2f5f8c;
    --accent-hover: #3b6ea5;
    --accent-glow: rgba(47, 95, 140, 0.15);
    --gradient-accent: linear-gradient(135deg, #2f5f8c 0%, #5a6a82 100%);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 12px 36px rgba(0, 0, 0, 0.14);
    --shadow-header: 0 2px 16px rgba(0, 0, 0, 0.06);
    --shadow-btn: 0 4px 14px rgba(47, 95, 140, 0.25);
    --shadow-btn-hover: 0 8px 24px rgba(47, 95, 140, 0.4);
    --icon-bg: rgba(47, 95, 140, 0.1);
    --icon-border: rgba(47, 95, 140, 0.18);
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-track: #f1f5f9;
    --toggler-filter: none;
}

/* ===== TRANSITION ===== */
:root {
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    min-height: 100vh;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text-body);
    transition: background 0.4s ease, color 0.4s ease;
}

main {
    flex: 1;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.lead {
    color: var(--text-body);
    font-size: 1.1rem;
    line-height: 1.8;
}

.text-muted {
    color: var(--text-muted) !important;
}

.display-4, .display-5, .display-3 {
    color: var(--text-heading);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.fade-in-delay {
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

/* ===== HEADER ===== */
.site-header {
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-header);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    color: var(--accent);
    font-size: 1.2rem;
    transition: var(--transition);
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.navbar-toggler-icon {
    filter: var(--toggler-filter);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--accent);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    transform: rotate(20deg) scale(1.1);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/images/hero-tech.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-hero-overlay);
    z-index: 2;
}

.hero-section .container {
    position: relative;
    z-index: 3;
}

.hero-section h1,
.hero-section .lead,
.hero-section .badge {
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* ===== PAGE HEADER ===== */
.page-header {
    position: relative;
    overflow: hidden;
    padding: 5rem 0 3rem;
    min-height: 35vh;
    display: flex;
    align-items: center;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-hero-overlay);
    z-index: 2;
}

.page-header.services-header::before { background-image: url('/images/services/custom-development.jpg'); }
.page-header.technologies-header::before { background-image: url('/images/technologies/dotnet.jpg'); }
.page-header.references-header::before { background-image: url('/images/references/ref1.jpg'); }
.page-header.about-header::before { background-image: url('/images/about-team.jpg'); }

.page-header .container {
    position: relative;
    z-index: 3;
}

.page-header h1,
.page-header .lead,
.page-header .badge {
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--border-card);
    border-radius: 20px;
    transition: var(--transition);
    overflow: hidden;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
    z-index: 10;
}

.card:hover::before {
    transform: scaleX(1);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.card-body {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.card-title {
    color: var(--text-heading);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.7;
}

.card-img-top {
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

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

/* ===== ICON BOX ===== */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    color: var(--accent);
    transition: var(--transition);
}

.card:hover .icon-box {
    background: var(--accent-glow);
    transform: scale(1.1);
    border-color: var(--accent);
}

/* ===== FEATURE BOX ===== */
.feature-box {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-card);
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-card);
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 14px;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--gradient-accent);
    box-shadow: var(--shadow-btn);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-btn-hover);
    filter: brightness(1.1);
}

.btn-outline-primary {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--gradient-accent);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: var(--shadow-btn);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-3px);
}

/* ===== BADGE ===== */
.badge {
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.bg-gradient {
    background: var(--gradient-accent) !important;
    color: #ffffff;
}

/* ===== ICONS ===== */
.bi {
    filter: none;
}

/* ===== FOOTER ===== */
footer {
    margin-top: auto;
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    transition: background 0.4s ease;
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    color: var(--accent) !important;
    transform: translateX(4px);
    display: inline-block;
}

/* ===== SECTIONS ===== */
.bg-light {
    background: var(--bg-surface) !important;
    transition: background 0.4s ease;
}

/* ===== FORMS ===== */
.form-control,
.form-select {
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text-heading);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-input);
    color: var(--text-heading);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===== FORM LABELS ===== */
.form-label {
    color: var(--text-heading);
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

/* ===== LOADING SPINNER ===== */
.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.25rem;
    color: var(--accent);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 14px;
    border: none;
    padding: 1.25rem;
}

.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

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

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

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

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
    position: relative;
}

.language-select {
    min-width: 140px;
    max-width: 180px;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 0.45rem 2.2rem 0.45rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    background-color: var(--bg-card);
    color: var(--text-heading);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2360a5fa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px 10px;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.language-select:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.language-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.language-select option {
    background: var(--bg-card);
    color: var(--text-heading);
}

.language-select::-ms-expand {
    display: none;
}

/* ===== STATS BADGE ===== */
.stats-badge {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.85rem 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
    z-index: 10;
    transition: var(--transition);
}

.stats-badge:hover {
    transform: scale(1.04);
    border-color: var(--accent);
}

.stats-badge .text-muted {
    color: var(--text-muted) !important;
}

.stats-badge .text-primary {
    color: var(--accent) !important;
}

/* ===== GLASSMORPHISM ===== */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
}

/* ===== IMAGES ===== */
.hero-image img {
    border-radius: 20px;
    box-shadow: var(--shadow-card-hover);
    border: 2px solid var(--border-card);
    transition: var(--transition);
}

.hero-image img:hover {
    transform: scale(1.02) translateY(-4px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar-collapse {
        background: var(--bg-card);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 1.25rem;
        border-radius: 16px;
        margin-top: 0.75rem;
        border: 1px solid var(--border-card);
        box-shadow: var(--shadow-card);
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section {
        padding: 3.5rem 0;
        min-height: 55vh;
    }

    .page-header {
        padding: 3rem 0 2rem;
        min-height: 28vh;
    }

    .display-3 { font-size: 2rem; }
    .display-4 { font-size: 1.8rem; }
    .display-5 { font-size: 1.5rem; }

    .card-body {
        padding: 1.5rem;
    }

    .icon-box {
        width: 56px;
        height: 56px;
    }
}

/* ===== BLAZOR ERROR UI ===== */
#blazor-error-ui {
    background: #dc2626;
    bottom: 0;
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #ffffff;
    border-top: 3px solid #991b1b;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
}

/* ===== BLAZOR VALIDATION ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbn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43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ===== BOOTSTRAP OVERRIDES FOR THEMING ===== */
.text-primary {
    color: var(--accent) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.bg-white {
    background-color: var(--bg-card) !important;
}

.text-dark {
    color: var(--text-heading) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.55) !important;
}