/* Advanced Bornholm Site Styles */

/* Page background with image - only for home page in light mode */
body.home-page:not([data-theme="dark"]) {
    background-image: url('../gfx/hero-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Overlay for better readability - only for home page in light mode */
body.home-page:not([data-theme="dark"])::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: -1;
}

/* Dark mode home page */
body.home-page[data-theme="dark"] {
    background-color: #1a202c !important;
    background-image: none !important;
}

/* Default page background */
body {
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease;
}

/* Dark mode body background - highest specificity */
html[data-theme="dark"] body,
body[data-theme="dark"],
[data-theme="dark"] body {
    background-color: #1a202c !important;
    background-image: none !important;
    color: #e2e8f0 !important;
}

/* Override any other background */
body[data-theme="dark"]::before,
body[data-theme="dark"]::after {
    display: none !important;
}

/* Dark mode html background too */
html {
    transition: background-color 0.3s ease;
}

body[data-theme="dark"] html,
html:has(body[data-theme="dark"]) {
    background-color: #1a202c !important;
}

/* Main content should grow to push footer down */
main {
    flex: 1;
}

:root {
    --primary-gradient: linear-gradient(135deg, #9fd6d3 0%, #5fb3af 100%);
    --secondary-gradient: linear-gradient(135deg, #a8e6cf 0%, #7fcdcd 100%);
    --primary-color: #9fd6d3;
    --primary-dark: #5fb3af;
    --primary-light: #c4e8e5;
    --accent-color: #7fcdcd;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Parallax Hero Section */
.hero-parallax {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-content .row {
    padding-top: 0 !important;
}

@media (min-width: 768px) {
    .hero-content .row {
        padding-top: 1rem !important;
    }
}

@media (min-width: 1024px) {
    .hero-content .row {
        padding-top: 2rem !important;
    }
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 120%;
    height: 120%;
    background: linear-gradient(135deg, #9fd6d3 0%, #5fb3af 100%);
    background-attachment: fixed;
    /* Performance optimizations */
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden;
    contain: layout style paint;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #c4e8e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Morphism Effects */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

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

/* Animated Buttons */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(159, 214, 211, 0.4);
}

/* Animated Statistics */
.stat-card {
    transition: all 0.3s ease;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #c4e8e5;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-arrow {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    animation: bounce 2s infinite;
    transition: all 0.3s ease;
    /* Mobile touch improvements */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.scroll-arrow:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.scroll-arrow:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.2);
    border-color: white;
}

/* Mobile specific styles */
@media (max-width: 991.98px) {
    .scroll-arrow {
        /* Same size as desktop */
        width: 50px;
        height: 50px;
        border-width: 2px;
    }
    
    .scroll-indicator {
        bottom: 20px;
        /* Closer to bottom on mobile */
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Weather Widget */
.weather-widget {
    animation: slideInRight 0.5s ease-out;
    top: 130px !important;
}

@media (min-width: 992px) {
    .weather-widget {
        top: 140px !important;
    }
}

@media (max-width: 991.98px) {
    .weather-widget {
        top: 110px !important;
    }
}

.weather-card {
    min-width: 120px;
    color: white;
    background: rgba(33, 37, 41, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Desktop weather widget styling */
@media (min-width: 992px) {
    .weather-widget .weather-card {
        min-width: 100px;
        padding: 0.75rem !important;
        border-radius: 1rem;
        transform: scale(0.9);
        background: rgba(255, 255, 255, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        backdrop-filter: blur(15px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .weather-widget .weather-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .weather-widget .weather-temp {
        font-size: 1.2rem;
        margin: 0.25rem 0;
    }
    
    .weather-widget .weather-desc {
        font-size: 0.8rem;
    }
    
    .weather-widget small {
        font-size: 0.7rem;
    }
}

.weather-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.weather-temp {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.weather-desc {
    color: var(--primary-color);
}

/* Weather loading animation */
.weather-icon .bi-arrow-clockwise {
    animation: spin 1s linear infinite;
    color: var(--primary-color);
    opacity: 0.8;
}

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

/* Weather widget fade-in animation */
.weather-widget .weather-card,
.weather-widget-mobile .weather-card {
    transition: all 0.3s ease-in-out;
}

/* Weather data loaded state */
.weather-loaded .weather-icon {
    animation: fadeInScale 0.5s ease-out;
}

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

.weather-card small {
    color: white !important;
}

/* Explore Photo Gallery */
.explore-photo {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.explore-photo:hover {
    transform: translateY(-5px);
}

.explore-photo img {
    transition: transform 0.3s ease;
}

.explore-photo:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.explore-photo:hover .photo-overlay {
    transform: translateY(0);
}

.photo-content h5 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.photo-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Featured Image Section */
.featured-image-container {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.featured-image-container:hover {
    transform: translateY(-5px);
}

.featured-image-container img {
    transition: transform 0.3s ease;
}

.featured-image-container:hover img {
    transform: scale(1.02);
}

.image-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    transition: all 0.3s ease;
}

.featured-image-container:hover .image-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.overlay-content h4 {
    font-weight: 600;
}

.overlay-content p {
    opacity: 0.9;
}

/* Introduction Cards */
.intro-card {
    transition: transform 0.3s ease;
}

.intro-card:hover {
    transform: translateY(-10px);
}

.intro-card .card {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.intro-card:hover .card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.intro-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.intro-icon i {
    font-size: 2.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.intro-card:hover .intro-icon {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(159, 214, 211, 0.3);
}

.intro-card:hover .intro-icon i {
    transform: scale(1.1);
}

.intro-card .btn {
    transition: all 0.3s ease;
    border-width: 2px;
}

.intro-card .btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(159, 214, 211, 0.4);
}

/* Gallery Styles */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

/* Icon Circle */
.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Enhanced Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(33, 37, 41, 0.9) !important;
    transition: all 0.3s ease;
    padding: 1.5rem 0;
    min-height: 90px;
}

@media (min-width: 992px) {
    .navbar {
        padding: 1.75rem 0;
        min-height: 100px;
    }
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-collapse {
    transition: all 0.3s ease-in-out;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(33, 37, 41, 0.95);
        margin-top: 1rem;
        border-radius: 0.5rem;
        padding: 1rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-item {
        margin: 0 auto;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.25rem;
        margin: 0.25rem 0;
        display: inline-block;
        width: auto;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Dark mode toggle button on mobile */
    #themeToggle {
        margin-top: 1rem;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

.navbar {
    /* Performance optimizations for scroll effects */
    will-change: background-color, box-shadow;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background: rgba(33, 37, 41, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.navbar-brand img {
    max-height: 50px;
    margin-top: 3px;
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Animations */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Mobile and Tablet Responsive Design */
@media (max-width: 991.98px) {
    /* Remove margin from theme toggle button on mobile */
    #themeToggle {
        margin-left: 0 !important;
    }
    
    .hero-parallax {
        height: auto;
        min-height: auto;
        padding: 3rem 0;
        background: linear-gradient(135deg, #9fd6d3 0%, #5fb3af 100%);
        position: relative;
    }
    
    /* Hide parallax elements on mobile */
    .hero-parallax .parallax-bg,
    .hero-parallax .hero-overlay {
        display: none;
    }
    
    .hero-content {
        position: static;
        z-index: 1;
    }
    
    .hero-content .row {
        padding: 2rem 0;
        min-height: auto;
    }
    
    .hero-text {
        margin-bottom: 3rem;
        padding: 0 1rem;
    }
    
    .hero-stats {
        padding: 0 1rem;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .hero-stats .row {
        margin: 0 -0.5rem;
    }
    
    .hero-stats .col-6 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    
    .display-3 {
        font-size: 2.8rem;
        line-height: 1.1;
        margin-bottom: 2rem !important;
    }
    
    .hero-buttons {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 0.75rem 0 !important;
    }
    
    .hero-buttons .btn:last-child {
        margin-bottom: 0 !important;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
        padding: 1.5rem !important;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    /* Weather widget - move to content area on mobile */
    .weather-widget {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin: 2rem auto;
        text-align: center;
        max-width: 250px;
        order: -1;
    }
    
    .weather-card {
        background: rgba(33, 37, 41, 0.9) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        padding: 1.5rem !important;
    }
    
    .weather-temp {
        font-size: 2rem !important;
        margin: 0.5rem 0;
    }
    
    .weather-icon {
        font-size: 2.5rem !important;
    }
    
    /* Mobile weather widget specific styles */
    .weather-widget-mobile {
        margin: 1.5rem 0;
        padding: 1rem 0;
    }
    
    .weather-widget-mobile .weather-card {
        /* Styles handled by JavaScript */
    }
    
    .weather-widget-mobile .weather-temp {
        font-size: 2rem !important;
        font-weight: bold;
        margin: 0.75rem 0;
    }
    
    .weather-widget-mobile .weather-icon {
        font-size: 2.5rem !important;
        margin-bottom: 0.75rem;
    }
    
    .weather-widget-mobile .weather-desc {
        font-size: 1rem;
        margin: 0.5rem 0;
    }
    
    .weather-widget-mobile small {
        font-size: 0.9rem !important;
    }
    
    /* Loading animation - improved */
    .weather-loading .bi-arrow-clockwise,
    .weather-icon .bi-arrow-clockwise {
        animation: spin 1s linear infinite;
        opacity: 0.8;
    }
    
    /* Pulse effect for loading text */
    .weather-desc:contains("Loading") {
        animation: pulse 1.5s ease-in-out infinite;
    }
    
    @keyframes pulse {
        0%, 100% { opacity: 0.6; }
        50% { opacity: 1; }
    }
    
    /* Mobile weather error state */
    .weather-error {
        color: #ff6b6b !important;
        font-size: 0.9rem;
    }
    
    /* Mobile weather success state */
    .weather-success .weather-icon {
        animation: bounceIn 0.6s ease-out;
    }
    
    @keyframes bounceIn {
        0% { transform: scale(0.3); opacity: 0; }
        50% { transform: scale(1.05); }
        70% { transform: scale(0.9); }
        100% { transform: scale(1); opacity: 1; }
    }
}

/* Dark Mode Support */
[data-theme="dark"] {
    --glass-bg: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-gradient: linear-gradient(135deg, #4a7c7a 0%, #2d5654 100%);
    --primary-color: #4a7c7a;
    --primary-dark: #2d5654;
    --primary-light: #6b9d9a;
}

[data-theme="dark"] body {
    background-color: #1a202c;
    color: #e2e8f0;
}

[data-theme="dark"] .bg-light {
    background-color: #2d3748 !important;
}

[data-theme="dark"] .card {
    background-color: #2d3748;
    color: #e2e8f0;
}

[data-theme="dark"] .text-muted {
    color: #a0aec0 !important;
}

[data-theme="dark"] .parallax-bg {
    background: linear-gradient(135deg, #2d5654 0%, #1a3736 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

/* Theme Toggle Button */
#themeToggle {
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#themeToggle:hover {
    transform: rotate(180deg);
    background-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] #themeToggle {
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .weather-card {
    background: rgba(45, 86, 84, 0.85) !important;
    border-color: rgba(159, 214, 211, 0.4);
}

[data-theme="dark"] .weather-icon {
    color: var(--primary-light);
}

/* jQuery Weather Plugin Styles */
#weatherWidget {
    background: rgba(33, 37, 41, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    color: white;
    text-align: center;
    min-width: 120px;
    line-height: 1.2;
}

#weatherWidget .ow-today {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

#weatherWidget .ow-today span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#weatherWidget .ow-today h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

#weatherWidget .ow-today h3 span {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: normal;
    display: block;
    margin: 0;
}

#weatherWidget .ow-today h3 b {
    color: white;
    font-size: 0.8rem;
    font-weight: normal;
    display: block;
    margin: 0;
}

#weatherWidget img {
    width: 32px;
    height: 32px;
    margin-bottom: 0.25rem;
}

[data-theme="dark"] .weather-desc {
    color: var(--primary-light);
}

/* Dark mode fixes for sections */
[data-theme="dark"] .bg-light {
    background-color: #2d3748 !important;
}

[data-theme="dark"] .display-5,
[data-theme="dark"] h2,
[data-theme="dark"] h4 {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .text-muted {
    color: #a0aec0 !important;
}

[data-theme="dark"] .intro-card .card {
    background: rgba(45, 55, 72, 0.9) !important;
    color: #e2e8f0;
}

[data-theme="dark"] .card {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
    border-color: #4a5568 !important;
}

[data-theme="dark"] .icon-circle,
[data-theme="dark"] .bg-primary {
    background: var(--primary-gradient) !important;
}

[data-theme="dark"] .bg-light {
    background-color: #374151 !important;
}

/* Enhanced Footer */
footer {
    min-height: 160px;
    display: flex;
    align-items: center;
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

footer .container {
    width: 100%;
}

footer h5 {
    margin-bottom: 1rem;
    font-weight: 600;
}

footer p {
    line-height: 1.6;
}

@media (min-width: 768px) {
    footer .row {
        align-items: end;
        min-height: 80px;
    }
}

@media (max-width: 767.98px) {
    footer .col-md-6:last-child p {
        margin-top: 2rem !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.2);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
}
