/* Custom CSS for 0x524E OÜ Website */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 0.375rem;
    --box-shadow: 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;
}

/* Base styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
    padding-top: 76px; /* Account for fixed navbar */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline-light {
    color: white;
    border-color: white;
}

.btn-outline-light:hover {
    background-color: white;
    color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Navigation */
.navbar {
    box-shadow: var(--box-shadow);
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0e27 0%, #1e3c72 50%, #2a5298 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    color: white;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 118, 117, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.1), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 8s linear infinite;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

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

.hero-content {
    animation: slideInLeft 1s ease-out;
}

.hero-badge .badge {
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

.hero-title {
    line-height: 1.1;
    margin-bottom: 2rem;
}

.text-gradient {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.typing-text {
    position: relative;
    display: inline-block;
}

.typing-text::after {
    content: '';
    position: absolute;
    right: -3px;
    width: 2px;
    height: 1em;
    background: white;
    animation: blink 1s infinite;
}

.hero-subtitle {
    animation: slideInLeft 1s ease-out 0.3s both;
}

.hero-stats {
    animation: slideInLeft 1s ease-out 0.6s both;
}

.stat-item {
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.hero-buttons {
    animation: slideInLeft 1s ease-out 0.9s both;
}

.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-animated:hover .btn-arrow {
    transform: translateX(5px);
}

.hero-image-container {
    animation: slideInRight 1s ease-out 0.5s both;
}

.hero-image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.hero-image {
    transition: transform 0.3s ease;
    border-radius: 20px;
}

.hero-image:hover {
    transform: scale(1.05);
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    animation: float 3s ease-in-out infinite;
}

.floating-icon:nth-child(1) { animation-delay: -1s; }
.floating-icon:nth-child(2) { animation-delay: -2s; }
.floating-icon:nth-child(3) { animation-delay: -3s; }

/* Page Header */
.page-header {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    transition: var(--transition);
    overflow: hidden;
}

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

.card-body {
    padding: 2rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.img-fluid {
    width: 100%;
    height: auto;
}

/* Sections */
section {
    padding: 5rem 0;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

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

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Form validation styles */
.was-validated .form-control:valid {
    border-color: var(--success-color);
}

.was-validated .form-control:invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 1rem 0;
    z-index: 1040;
    border-top: 3px solid var(--primary-color);
}

.cookie-consent p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.cookie-consent a {
    color: var(--info-color);
    text-decoration: underline;
}

.cookie-consent a:hover {
    color: white;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background-color: var(--light-color);
    font-weight: 600;
    border-top: none;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
}

.alert-heading {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Accordion */
.accordion-item {
    border: none;
    border-radius: var(--border-radius) !important;
    margin-bottom: 0.5rem;
    box-shadow: var(--box-shadow);
}

.accordion-button {
    background-color: white;
    border: none;
    font-weight: 500;
    padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.accordion-body {
    padding: 1.5rem;
    background-color: white;
}

/* Footer */
footer {
    background-color: var(--dark-color) !important;
    color: white;
}

footer h5, footer h6 {
    color: white;
    margin-bottom: 1rem;
}

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

footer .text-white-50:hover {
    color: white !important;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Social Media Icons */
.fab, .fas {
    transition: var(--transition);
}

footer a:hover .fab,
footer a:hover .fas {
    transform: translateY(-2px);
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

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

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

/* Loading Animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Form Success/Error Messages */
.form-message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    font-weight: 500;
}

.form-message.success {
    background-color: #d1f2eb;
    border: 1px solid var(--success-color);
    color: #0f5132;
}

.form-message.error {
    background-color: #f8d7da;
    border: 1px solid var(--danger-color);
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .hero-section {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    .page-header {
        padding: 6rem 0 3rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .cookie-consent .col-md-3 {
        text-align: center;
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0 !important;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .cookie-consent,
    footer {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
    
    .page-header {
        background: none !important;
        color: black !important;
        padding: 2rem 0 1rem;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* Accessibility Improvements */
.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;
}

/* Focus Styles for Better Accessibility */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn-primary {
        border: 2px solid var(--dark-color);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

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

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

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

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

/* About Section */
.about-section {
    background: linear-gradient(45deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
}

.about-image-container {
    position: relative;
}

.image-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.about-image {
    transition: transform 0.3s ease;
    width: 100%;
    height: auto;
}

.image-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-frame:hover .image-overlay {
    opacity: 1;
}

.tech-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tech-badge {
    background: rgba(13, 110, 253, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.3));
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 60px;
    height: 60px;
    top: 10%;
    right: -10%;
    animation-delay: -2s;
}

.shape-2 {
    width: 40px;
    height: 40px;
    bottom: 20%;
    left: -5%;
    animation-delay: -4s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: -15%;
    animation-delay: -1s;
}

.section-badge .badge {
    border: 1px solid rgba(13, 110, 253, 0.2);
    font-weight: 500;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-color), #4ecdc4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-content h6 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.slide-up {
    transform: translateY(30px);
    opacity: 0;
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes sparkle {
    0% { transform: translateX(0); }
    100% { transform: translateX(200px); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Form Message Styles */
.form-message {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid;
    animation: slideDown 0.3s ease;
}

.form-message.success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.form-message.error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.form-message.warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Performance Optimizations */
.img-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.img-lazy.loaded {
    opacity: 1;
}
