/**
 * 선생님 안내 문자 템플릿 스타일
 */

.sms-wrapper {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.sms-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* 왼쪽: 예약 목록 */
.sms-reservations {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
    min-height: 600px;
    position: sticky;
    top: 1.5rem;
}

.sms-reservations h3 {
    font-size: 16px;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* 선택된 예약 정보 박스 */
.selected-reservation-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.selected-badge {
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.3);
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.65rem;
}

.selected-customer {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 0.65rem;
    letter-spacing: -0.01em;
}

.selected-details {
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.reservation-quick-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - 500px);
    min-height: 400px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* 스크롤바 스타일 */
.reservation-quick-list::-webkit-scrollbar {
    width: 6px;
}

.reservation-quick-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.reservation-quick-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.reservation-quick-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.reservation-quick-item {
    padding: 0.875rem;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.reservation-quick-item:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.reservation-quick-item.selected {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.quick-check {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    font-size: 16px;
    line-height: 1;
}

.quick-date {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.35rem;
}

.quick-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.quick-customer {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    padding-right: 1.5rem;
}

.quick-tour {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* 오른쪽: 템플릿 그리드 */
.sms-templates {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sms-templates h3 {
    font-size: 18px;
    margin: 0;
    color: #1f2937;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.template-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 1.125rem 1.25rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
}

/* 제목 입력 필드 */
.template-title-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    transition: all 0.2s;
}

.template-title-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.template-title-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-delete-template {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.btn-delete-template:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* 빈 상태 */
.empty-template-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-template-state h4 {
    font-size: 18px;
    color: #374151;
    margin-bottom: 0.5rem;
}

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

.template-body {
    padding: 1.25rem;
}

.template-textarea {
    width: 100%;
    min-height: 180px;
    padding: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #374151;
    background: white;
    resize: vertical;
    transition: all 0.2s;
}

.template-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fefefe;
}

.template-textarea[readonly] {
    background: #f9fafb;
    cursor: default;
}

.template-actions {
    padding: 1.125rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
}

.btn-block {
    flex: 1;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* 반응형 - 태블릿 */
@media (max-width: 1024px) {
    .sms-content {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }
    
    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .sms-wrapper {
        padding: 1rem;
    }
    
    .sms-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sms-reservations {
        position: static;
        max-height: none;
    }
    
    .reservation-quick-list {
        max-height: 350px;
        min-height: 200px;
    }
    
    .selected-reservation-info {
        padding: 1rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-textarea {
        min-height: 160px;
    }
    
    .template-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .template-header {
        padding: 1rem;
        min-height: 50px;
    }
}

/* 복사 성공 애니메이션 */
@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.btn-primary.copy-success {
    animation: copySuccess 0.3s ease;
}

/* ============================================
   투어 기준 목록 스타일 (teachercalendar와 동일)
   ============================================ */

/* 투어 아이템 컨테이너 */
.tour-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.tour-item:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.1);
}

/* 투어 헤더 (날짜, 시간, 인원) */
.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.tour-date-time {
    font-size: 15px;
    color: #1f2937;
}

.tour-date-time strong {
    font-weight: 700;
    color: #6366f1;
}

.tour-count {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
}

/* 투어 이름 */
.tour-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0;           /* ✅ 마진 제거 */
    padding-left: 0.5rem;
    border-left: 2px solid #cbd5e1;
}

/* 예약자 목록 컨테이너 */
.tour-reservations {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
}

/* 예약자 개별 행 */
.reservation-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reservation-row:last-child {
    margin-bottom: 0;
}

.reservation-row:hover {
    background: #f0f9ff;
    border-color: #6366f1;
}

.reservation-row.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* 예약자 번호 */
.res-number {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    min-width: 20px;
}

/* 예약자 이름 */
.res-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    flex-shrink: 0;        /* ✅ min-width 제거, 축소 방지 */
}

/* 예약자 연락처 */
.res-phone {
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;        /* ✅ flex: 1 제거, 축소 방지 */
}

/* 예약자 메모 */
.res-memo {
    font-size: 12px;
    color: #059669;
    background: #d1fae5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 선택 체크 표시 */
.res-check {
    font-size: 16px;
    margin-left: auto;
}

/* 예약자 없을 때 */
.tour-no-reservations {
    text-align: center;
    padding: 1rem;
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

/* 투어 목록 반응형 추가 */
@media (max-width: 768px) {
    .tour-header {
        flex-direction: row;        /* ✅ 한 줄 유지 */
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;          /* ✅ 줄바꿈 방지 */
    }
    
    .reservation-row {
        flex-wrap: nowrap;          /* ✅ 한 줄 유지 */
        gap: 0.25rem;
    }
    
    /* ✅ 전화번호/메모 한 줄 유지 */
    .res-phone {
        width: auto;
        margin-left: 0;
        flex-shrink: 0;
    }
    
    .res-memo {
        width: auto;
        margin-left: auto;
        max-width: none;
        flex-shrink: 0;
    }
}
