/* ========================================
   전체 프로젝트 모달 & 토스트 통합 수정
   ======================================== */

/* ===== 모달 배경 수정 ===== */
/* 모든 모달의 배경을 불투명한 흰색으로 통일 */
.modal-content,
.modal-dialog,
.modal-wrapper,
[class*="modal"] .content,
[id*="Modal"] .content,
[id*="modal"] .content {
    background-color: #ffffff !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

/* modal-header와 modal-body 스타일은 style.css에서 통합 관리 */

.modal-footer,
[class*="modal-footer"],
[class*="modal"] .footer {
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

/* 모달 내부 폼 요소들 */
.modal .form-control,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal textarea,
.modal select {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e5e7eb !important;
}

.modal .form-label,
.modal label {
    color: #374151 !important;
}

/* 다크모드에서도 모달은 밝은 배경 유지 */
body.dark-mode .modal-content,
body.dark-mode .modal-dialog,
body.dark-mode .modal-wrapper,
body.dark-mode [class*="modal"] .content,
body.dark-mode [id*="Modal"] .content {
    background-color: #ffffff !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

body.dark-mode .modal-header,
body.dark-mode [class*="modal-header"] {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

body.dark-mode .modal-body,
body.dark-mode [class*="modal-body"] {
    background-color: #ffffff !important;
    color: #333333 !important;
}

body.dark-mode .modal-footer,
body.dark-mode [class*="modal-footer"] {
    background-color: #f9fafb !important;
}

body.dark-mode .modal .form-control,
body.dark-mode .modal input,
body.dark-mode .modal textarea,
body.dark-mode .modal select {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #e5e7eb !important;
}

body.dark-mode .modal .form-label,
body.dark-mode .modal label {
    color: #374151 !important;
}

/* ===== 토스트 메시지 통합 스타일 ===== */
.toast-message,
.toast,
[class*="toast"],
#toastContainer .toast,
.toast-notification {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    background-color: #1f2937 !important;
    color: #ffffff !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    z-index: 10001 !important;
    min-width: 280px !important;
    max-width: 400px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    border-left: 4px solid transparent !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

/* 토스트 타입별 색상 */
.toast.success,
.toast-message.success,
[class*="toast"].success {
    background-color: #10b981 !important;
    border-left-color: #065f46 !important;
    color: #ffffff !important;
}

.toast.error,
.toast-message.error,
[class*="toast"].error {
    background-color: #ef4444 !important;
    border-left-color: #991b1b !important;
    color: #ffffff !important;
}

.toast.warning,
.toast-message.warning,
[class*="toast"].warning {
    background-color: #f59e0b !important;
    border-left-color: #92400e !important;
    color: #ffffff !important;
}

.toast.info,
.toast-message.info,
[class*="toast"].info {
    background-color: #3b82f6 !important;
    border-left-color: #1e40af !important;
    color: #ffffff !important;
}

/* 토스트 표시 상태 */
.toast.show,
.toast-message.show,
[class*="toast"].show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) translateX(0) !important;
}

/* 토스트 아이콘 */
.toast i,
.toast-message i,
[class*="toast"] i {
    font-size: 1.25rem !important;
    color: #ffffff !important;
}

/* 다크모드에서도 토스트는 동일한 스타일 유지 */
body.dark-mode .toast,
body.dark-mode .toast-message,
body.dark-mode [class*="toast"] {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

body.dark-mode .toast.success,
body.dark-mode .toast-message.success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

body.dark-mode .toast.error,
body.dark-mode .toast-message.error {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

body.dark-mode .toast.warning,
body.dark-mode .toast-message.warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
}

body.dark-mode .toast.info,
body.dark-mode .toast-message.info {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .toast,
    .toast-message,
    [class*="toast"] {
        bottom: 1rem !important;
        right: 1rem !important;
        left: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }
}

/* 애니메이션 */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.show,
.toast-message.show {
    animation: slideInUp 0.3s ease-out forwards;
}

/* 특정 모달 추가 수정 */
#resetPasswordModal .modal-content,
#addStudentModal .modal-content,
#editStudentModal .modal-content,
#dictationModal .modal-content {
    background-color: #ffffff !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

/* 비밀번호 초기화 모달 특별 처리 */
#resetPasswordModal .modal-body,
#resetPasswordModal .modal-header,
#resetPasswordModal .modal-footer {
    background-color: #ffffff !important;
}

#resetPasswordModal .form-control,
#resetPasswordModal input {
    background-color: #ffffff !important;
    color: #333333 !important;
}

#resetPasswordModal label {
    color: #374151 !important;
}