/* Global Styles */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --accent-color: #fd79a8;
}

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    padding-top: 56px; /* Account for fixed navbar */
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    margin: 0 0.5rem;
}

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

/* Image Section */
.image-section {
    margin-top: 56px; /* Account for fixed navbar */
    width: 100%;
    overflow: hidden;
}

.image-section img {
    display: block;
    width: 100%;
    height: auto;
}

/* Hero Section */
#home {
    background-color: #f8f9fa; /* Fallback color */
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.6) 0%, rgba(45, 52, 54, 0.6) 100%),
                url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
    z-index: 0;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 80%;
    max-height: 600px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 400"><path d="M250,40 L280,45 L310,55 L340,75 L360,100 L375,130 L380,160 L375,190 L365,220 L350,245 L330,265 L305,280 L275,290 L245,295 L215,290 L185,280 L160,265 L140,245 L125,220 L115,190 L110,160 L115,130 L130,100 L150,75 L180,55 L210,45 L240,40 Z" fill="rgba(255,255,255,0.2)" stroke="rgba(255,255,255,0.4)" stroke-width="1.5"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    filter: blur(20px);
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    animation: watercolorSpread 8s ease-in-out infinite alternate;
}

@keyframes watercolorSpread {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
        opacity: 0.7;
    }
}

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

.slovakia-map {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.slovakia-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.3));
    animation: mapFadeIn 1.5s ease-in;
}

@keyframes mapFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

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

/* About Section */
#about {
    position: relative;
}

#about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 0;
}

#about .container {
    position: relative;
    z-index: 1;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Track Cards */
.track-card {
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
}

.track-card:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.track-card:hover .track-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Track Tooltip */
.track-tooltip {
    position: relative;
    overflow: visible !important;
}

.track-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    max-width: 300px;
    min-width: 200px;
    white-space: normal;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    word-wrap: break-word;
}

.track-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

.track-tooltip:hover::after,
.track-tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Track Explanation Section */
.track-explanation {
    background: white;
    pointer-events: none;
    user-select: text;
    flex: 1;
}

.track-explanation .card-body {
    padding: 1rem;
}

.track-html-content {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.track-html-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.track-html-content code {
    display: block;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #212529;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.track-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Member Cards */
.member-card {
    background: white;
    transition: all 0.3s ease;
}

.member-card:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-5px);
}

.member-card:hover .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
}

.member-card .card-title {
    font-weight: 700;
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.member-card:hover .card-title {
    color: white;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.cta-section .container {
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
}

.btn-outline-light {
    border: 2px solid white;
}

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

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

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

/* Footer */
footer {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .btn-lg {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .btn-lg:last-child {
        margin-bottom: 0;
    }
}

/* Accessibility */
:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth scroll offset for anchor links */
section {
    scroll-margin-top: 80px;
}