:root {
    --bg-gradient: linear-gradient(135deg, rgba(45, 43, 58, 0.7) 0%, rgba(31, 28, 44, 0.7) 100%);
    --card-gradient: linear-gradient(145deg, rgba(62, 53, 77, 0.75), rgba(45, 40, 58, 0.75));
    --accent-purple: #a78bfa;
    --accent-light: #d4c6e6;
    --text-primary: #e8e4ef;
    --text-secondary: #b4a4cc;
    --shadow-elegant: 0 10px 30px rgba(167, 139, 250, 0.2);
    --border-accent: rgba(167, 139, 250, 0.3);
    --link-color: #87ceeb;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: 'Cinzel', 'Yu Mincho', serif;
    line-height: 1.6;
    min-height: 100vh;
    background-attachment: fixed;
}

.container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
    z-index: 2;
}

.elegant-frame {
    position: relative;
    background: var(--card-gradient);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-elegant);
}

header {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    background: var(--card-gradient);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    box-shadow: var(--shadow-elegant);
}

header h1 {
    font-size: 3rem;
    margin: 0;
    background: linear-gradient(45deg, #a78bfa, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Cinzel Decorative', 'Yu Mincho', serif;
    letter-spacing: 0.1em;
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('siduririheader.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: -1;
}

.content-box {
    background: var(--card-gradient);
    border: 1px solid var(--border-accent);
    padding: 2rem;
    margin: 1.5rem 0;
    border-radius: 20px;
    box-shadow: var(--shadow-elegant);
}

h2 {
    color: var(--accent-purple);
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-accent);
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

#calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.week-schedule {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.week-schedule th {
    background: rgba(167, 139, 250, 0.1);
    padding: 12px;
    text-align: left;
    border-radius: 8px;
    font-weight: normal;
    color: var(--accent-light);
    width: 100px;
    vertical-align: top;
}

.week-schedule td {
    padding: 15px;
    background: rgba(62, 53, 77, 0.5);
    border-radius: 8px;
    vertical-align: top;
}

.schedule-event {
    background: rgba(167, 139, 250, 0.15);
    padding: 10px;
    margin: 4px 0;
    border-radius: 6px;
    border: 1px solid var(--border-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.schedule-event:hover {
    background: rgba(167, 139, 250, 0.2);
    transform: translateX(5px);
}

.schedule-actions {
    display: flex;
    gap: 5px;
}

.delete-event {
    background: rgba(220, 38, 127, 0.2) !important;
    border: 1px solid rgba(220, 38, 127, 0.4) !important;
    font-size: 0.8rem;
    padding: 4px 8px !important;
    color: #ff9999 !important;
    cursor: pointer;
    border-radius: 4px;
}

.delete-event:hover {
    background: rgba(220, 38, 127, 0.3) !important;
}

.modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999 !important;
    backdrop-filter: blur(5px);
    -moz-backdrop-filter: blur(5px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal-content {
    background: var(--card-gradient);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-elegant);
    max-width: 400px;
    margin: 20vh auto;
    backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    color: var(--accent-purple);
    margin-top: 0;
    text-align: center;
}

button {
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid var(--border-accent);
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

button:hover {
    background: rgba(167, 139, 250, 0.3);
    transform: translateY(-2px);
}

input, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: rgba(45, 40, 58, 0.8);
    border: 1px solid var(--border-accent);
    border-radius: 6px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

select {
    cursor: pointer;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

select option {
    background: rgba(45, 40, 58, 1);
    color: var(--text-primary);
    padding: 10px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--accent-purple);
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--link-color), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

a:hover::after {
    transform: scaleX(1);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.error-message {
    background: rgba(220, 38, 127, 0.1);
    border: 1px solid rgba(220, 38, 127, 0.3);
    color: #ff9999;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    #calendar-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .week-schedule th,
    .week-schedule td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .schedule-event {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .modal-content {
        margin: 10vh auto;
        max-width: 90%;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 3rem;
    }

    h1 {
        font-size: 3.5rem;
    }
}