/* 기본 스타일 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 메인 제목 */
.main-title {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 그리드 레이아웃 */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

/* 버튼 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* 이미지 컨테이너 */
.image-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.image-prompt {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #4a5568;
    border-left: 4px solid #667eea;
}

.generated-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.generated-image:hover {
    transform: scale(1.02);
}

/* 스크립트 컨테이너 */
.script-container {
    margin-bottom: 1.5rem;
}

.script-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 1rem;
}

.script-content {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid #48bb78;
    line-height: 1.8;
    color: #2d3748;
    font-size: 1rem;
}

/* 스크립트 가독성 개선 */
.board-script {
    background: #f8f9fa;
    padding: 1.75rem;
    border-radius: 12px;
    border-left: 5px solid #667eea;
    line-height: 2.0;
    color: #2d3748;
    font-size: 1.1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.board-script:hover {
    background: #f1f3f4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.board-script br {
    margin-bottom: 0.5rem;
    display: block;
}

/* 스크립트 토글 버튼 */
.script-toggle-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.script-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.script-toggle-btn.showing {
    background: #dc3545;
}

.script-toggle-btn i {
    font-size: 0.9rem;
}

/* 로딩 스타일 */
.loading-container {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 4px solid #667eea;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #4a5568;
    font-size: 1rem;
}

/* 초기 메시지 */
.initial-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.initial-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.initial-message p {
    line-height: 1.8;
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.9rem;
    }
    
    .generated-image {
        height: 250px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 스크롤바 스타일링 */
.script-content::-webkit-scrollbar {
    width: 8px;
}

.script-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.script-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.script-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
