/* Reset og base styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Dark mode styling */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    color: #e2e8f0;
}

/* Dark mode for cards */
body.dark-mode .news-card {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

body.dark-mode .news-title {
    color: #f7fafc;
}

body.dark-mode .news-description {
    color: #cbd5e0;
}

body.dark-mode .news-date {
    color: #a0aec0;
}

/* Dark mode for weather cards */
body.dark-mode .weather-card,
body.dark-mode .weather-sidebar .weather-card,
body.dark-mode .compact-weather-item {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .weather-sidebar {
    background: transparent !important;
}

body.dark-mode .weather-sidebar .weather-card {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .compact-weather-container {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .weather-container {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode #weatherContainer {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .weather-header h2 {
    color: #f7fafc !important;
}

body.dark-mode .last-updated {
    color: #a0aec0 !important;
}

body.dark-mode .compact-location .city-name {
    color: #f7fafc !important;
}

body.dark-mode .compact-location .region-name {
    color: #a0aec0 !important;
}

body.dark-mode .compact-desc {
    color: #cbd5e0 !important;
}

body.dark-mode .compact-details {
    color: #a0aec0 !important;
}

body.dark-mode .compact-temp {
    color: #f7fafc !important;
}

/* Dark mode for filter buttons */
body.dark-mode .filter-btn,
body.dark-mode .it-filter-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .filter-btn:hover,
body.dark-mode .it-filter-btn:hover,
body.dark-mode .filter-btn.active,
body.dark-mode .it-filter-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Tilbage til forsiden knap */
.back-to-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-to-main:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-main img {
    width: 20px;
    height: 20px;
    filter: invert(0.3);
}

.back-to-main:hover img {
    filter: invert(0.1);
}

/* Header og Navigation */
.header {
    background: rgba(102, 51, 153, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-brand h1 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Dark mode toggle */
.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #2d3748;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.refresh-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

/* Main content */
.main {
    padding: 2rem 0;
}

/* 3-kolonne layout grid */
.three-column-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 320px;
    gap: 2rem;
    align-items: start;
    width: 100%;
    max-width: 2400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Generelle og IT nyheder sektioner */
.general-news-section,
.it-news-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

/* Weather sidebar */
.weather-sidebar {
    position: sticky;
    top: 100px;
}

.weather-sidebar .weather-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-sidebar .weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.weather-sidebar .weather-header h2 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
}

.weather-sidebar .last-updated {
    color: #718096;
    font-size: 0.8rem;
}

/* Kompakt vejr design */
.compact-weather-container {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.compact-weather-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.compact-weather-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.compact-weather-item:first-child {
    padding-top: 0;
}

.compact-location {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.city-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.region-name {
    font-size: 0.8rem;
    color: #718096;
}

.compact-temp {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compact-desc {
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 0.4rem;
}

.compact-details {
    font-size: 0.75rem;
    color: #718096;
    line-height: 1.3;
}

.weather-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
}

.weather-source {
    font-size: 0.75rem;
    color: #718096;
}

.weather-sidebar .weather-loading {
    text-align: center;
    color: #718096;
    padding: 1.5rem;
    font-size: 0.9rem;
}

.weather-sidebar .weather-error {
    color: #ef4444;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

.news-filters,
.it-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: flex-start;
}

.filter-btn,
.it-filter-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active,
.it-filter-btn:hover,
.it-filter-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: none;
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.news-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.news-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.news-source {
    display: inline-block;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.news-category {
    display: inline-block;
    background: rgba(66, 153, 225, 0.1);
    color: #3182ce;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(66, 153, 225, 0.2);
}

.news-title {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.news-description {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #718096;
    font-size: 0.85rem;
}

.news-date {
    font-weight: 500;
}

.news-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: white;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.load-more-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet layout - 2 kolonner + sidebar */
    .three-column-layout {
        grid-template-columns: 1fr 250px;
        gap: 1.5rem;
    }
    
    .general-news-section {
        grid-column: 1;
        grid-row: 1;
    }
    
    .it-news-section {
        grid-column: 1;
        grid-row: 2;
    }
    
    .weather-sidebar {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 1200px) {
    /* Mindre skærme - gør vejr sidebar mindre */
    .three-column-layout {
        grid-template-columns: 2fr 2fr 260px;
        gap: 2rem;
    }
}

@media (max-width: 950px) {
    /* Tablet layout - stack vertically */
    .three-column-layout {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .weather-sidebar {
        grid-column: 1 / span 2;
        order: -1;
    }
}

@media (max-width: 768px) {
    /* Mobile layout - stack vertically */
    .three-column-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .weather-sidebar {
        position: static;
        order: -1; /* Vis vejr først på mobile */
    }
    
    /* Mobile kompakt vejr design */
    .compact-weather-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    
    .compact-weather-item {
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-bottom: none; /* Fjern border da vi nu har separate kort */
    }
    
    .compact-weather-item:last-child {
        border-bottom: none;
    }
    
    .weather-footer {
        grid-column: 1 / -1;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
    }

    .nav {
        padding: 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-list.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-brand h1 {
        font-size: 1.3rem;
    }

    .news-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .weather-content {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
    }

    .weather-card,
    .news-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem 0;
    }

    .news-header h2 {
        font-size: 1.5rem;
    }

    .weather-header h2 {
        font-size: 1.3rem;
    }

    .news-card {
        padding: 1rem;
    }

    .news-title {
        font-size: 1.1rem;
        word-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        overflow-wrap: break-word;
    }
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Animation for content loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.5s ease-out;
}

.news-card:nth-child(even) {
    animation-delay: 0.1s;
}

.news-card:nth-child(3n) {
    animation-delay: 0.2s;
}