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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #2c3e50;
    width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%);
    background-size: 20px 20px;
    z-index: -1;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(20px, -20px) rotate(1deg);
    }
    66% {
        transform: translate(-10px, 10px) rotate(-1deg);
    }
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header p {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}


main {
    max-width: 1200px;
    margin: 0 auto;
}

#calendar-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    table-layout: fixed;
}

th, td {
    border: none;
    padding: 15px 10px;
    text-align: center;
    word-wrap: break-word;
    vertical-align: top;
    position: relative;
    transition: all 0.3s ease;
}

th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

td:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.02);
}

.week-number {
    background: rgba(102, 126, 234, 0.1) !important;
    font-weight: 600;
    width: 4%;
    max-width: 4%;
    min-width: 40px;
    padding: 5px;
    color: #667eea;
    font-size: 0.8rem;
}

td:not(.week-number) {
    width: 13.71%; /* (100% - 4%) / 7 days = 96% / 7 */
    max-width: 13.71%;
}

.other-month {
    color: #bbb;
    opacity: 0.6;
}

.event {
    background: linear-gradient(135deg, #e8f5e8, #f0fff0) !important;
    font-weight: 600 !important;
    border: 2px solid #4caf50 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2) !important;
    transform: translateY(-2px) !important;
}

.event.martyrskap {
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0) !important;
    border: 2px solid #2c3e50 !important;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2) !important;
}

.event.blue {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    border: 2px solid #2196f3 !important;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2) !important;
}

.event:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3) !important;
}

form {
    margin-bottom: 1rem;
    background-color: white;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

input, select, button {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1rem;
}

button {
    background: #2c3e50;
    color: white;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.4);
    background: #34495e;
}

button:active {
    transform: translateY(0);
}

#event-list, #upcoming-events-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#event-list li, #upcoming-events-list li {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#event-list li:hover, #upcoming-events-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

#event-list li::before, #upcoming-events-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #2c3e50;
}

#event-list button {
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

#upcoming-events {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#upcoming-events h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

#calendar-links {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#calendar-links h3 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#calendar-links a {
    display: inline-block;
    margin-right: 1rem;
    color: #2e8b57;
    text-decoration: none;
}

#calendar-links a:hover {
    text-decoration: underline;
}

.ical-download {
    background: #2c3e50 !important;
    color: white !important;
    padding: 15px 30px;
    border-radius: 15px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.3);
    font-size: 1rem;
}

.ical-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.4);
    background: #34495e !important;
    text-decoration: none !important;
}

.today {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2) !important;
    font-weight: 700 !important;
    border: 2px solid #ff9800 !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3) !important;
    cursor: pointer;
    transform: translateY(-2px) !important;
    position: relative;
}


/* Responsive design */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    header {
        text-align: center;
        padding: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    #calendar-controls {
        flex-direction: row;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    #calendar-controls button {
        flex: 1;
        font-size: 0.7rem;
        padding: 10px 4px;
        white-space: nowrap;
    }

    table {
        font-size: 0.75rem;
        width: 100%;
        table-layout: fixed;
    }

    th, td {
        padding: 8px 2px;
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .week-number {
        width: 8%;
        min-width: 25px;
        font-size: 0.6rem;
        padding: 5px 1px;
    }

    td:not(.week-number) {
        width: 13.14%;
        max-width: 13.14%;
    }

    #upcoming-events, #calendar-links {
        padding: 1rem;
        margin: 0 -10px 1rem -10px;
        border-radius: 15px;
    }

    #upcoming-events h2, #calendar-links h3 {
        font-size: 1.4rem;
    }

    #event-list li, #upcoming-events-list li {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    input, select, button {
        width: 100%;
        box-sizing: border-box;
    }

    #event-list button {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
    }

    #calendar-links a {
        display: block;
        margin-bottom: 0.5rem;
    }

    .ical-download {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* Toast notification styles */
.toast {
    visibility: hidden;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.4);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}