/* ============================================
   DA.UM 학생 포털 - 반응형 개선 CSS
   ============================================ */

/* 1. 스크롤 탑 버튼 */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.scroll-top-btn:active {
    transform: translateY(-2px);
}

@media (max-width: 767px) {
    .scroll-top-btn {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
        font-size: 20px;
    }
}

/* 2. 토스트 알림 */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 15px;
    font-weight: 500;
    pointer-events: all;
    cursor: pointer;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .toast-container {
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: none;
    }
    
    .toast {
        min-width: 100%;
    }
}

/* 3. 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 5px solid #e5e7eb;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
}

/* 4. 폼 에러 스타일 */
input.error,
textarea.error,
select.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

input.error:focus,
textarea.error:focus,
select.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #ef4444;
    font-weight: 500;
}

/* 5. 빈 상태 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: #6b7280;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .empty-state {
        padding: 32px 16px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
}

/* 6. 스켈레톤 로더 타입들 */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-card {
    height: 120px;
    border-radius: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: 8px;
}

/* 7. 버튼 로딩 상태 */
.btn.loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 8. 페이드 인 애니메이션 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 9. 슬라이드 인 애니메이션 */
.slide-in-left {
    animation: slideInLeft 0.5s ease;
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 10. 카드 호버 확대 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 11. 리스트 아이템 애니메이션 */
.list-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.list-item:nth-child(1) { animation-delay: 0.1s; }
.list-item:nth-child(2) { animation-delay: 0.2s; }
.list-item:nth-child(3) { animation-delay: 0.3s; }
.list-item:nth-child(4) { animation-delay: 0.4s; }
.list-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 12. 배지 펄스 애니메이션 */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
    }
}

/* 13. 툴팁 */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 14. 포커스 표시 개선 */
.focus-visible:focus {
    outline: 3px solid #8b5cf6;
    outline-offset: 3px;
}

/* 15. 드래그 앤 드롭 영역 */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: #8b5cf6;
    background-color: #f5f3ff;
}

.drop-zone:hover {
    border-color: #8b5cf6;
}

/* 16. 진행 상태 인디케이터 */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.active .step-circle {
    background: #8b5cf6;
    color: white;
}

.progress-step.completed .step-circle {
    background: #10b981;
    color: white;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
}

/* 17. 카드 플립 효과 */
.card-flip-container {
    perspective: 1000px;
}

.card-flip {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-flip.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    backface-visibility: hidden;
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
}

/* 18. 리플 효과 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* 19. 반응형 간격 조정 */
@media (max-width: 767px) {
    .mobile-compact {
        padding: 12px !important;
    }
    
    .mobile-small-text {
        font-size: 14px !important;
    }
    
    .mobile-hide {
        display: none !important;
    }
}

/* 20. 완료! ✨ */
