/* --- General Components --- */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
    filter: brightness(1);
}

button:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
    filter: brightness(0.8);
}

#status {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 1001;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#status.show {
    visibility: visible;
    animation: fadeIn 0.5s, fadeOut 0.5s 3.5s;
}

#status.success {
    background-color: var(--success-color);
}

#status.info {
    background-color: var(--info-color);
}

#status.danger {
    background-color: var(--danger-color);
}

#status.primary {
    background-color: var(--primary-color);
}

@keyframes fadeIn {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

/* --- Forms --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.add-schedule-form input,
.add-schedule-form textarea,
#edit-schedule-form input,
#edit-schedule-form textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    background-color: var(--input-bg);
    color: var(--input-text);
    font-family: inherit;
}

.add-schedule-form textarea,
#edit-schedule-form textarea {
    resize: vertical;
    min-height: 80px;
}

.add-schedule-form .time-inputs,
#edit-schedule-form .time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-schedule-form .time-inputs input,
#edit-schedule-form .time-inputs input {
    flex: 1;
}

input[type="color"] {
    padding: 0;
    border: none;
    height: 40px;
    cursor: pointer;
    background-color: transparent;
    width: 100%;
}

.link-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.marker-link {
    font-size: 0.85rem;
    text-align: right;
    color: var(--secondary-color);
    text-decoration: none;
    margin-top: 0.25rem;
}

.marker-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940);
}

.modal-content.modal-lg {
    max-width: 800px;
}

@keyframes slideIn {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-modal-btn:hover {
    color: var(--text-color);
    background-color: transparent;
}

.modal-body {
    /* 모달 내부 컨텐츠를 위한 기본 스타일 */
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

#deleteScheduleBtn {
    background-color: var(--danger-color);
}

#deleteScheduleBtn:hover {
    background-color: #c82333;
}

.modal-actions button {
    flex: 1;
}

/* --- Theme Switcher --- */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}