/* 일기장 커스텀 스타일 */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #f3f4f6;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

/* 네비게이션 바는 고정 크기 */
.navbar {
    flex-shrink: 0;
}

/* 메인 컨텐츠 영역을 flex로 확장 */
body > .container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* 헤더 다음의 첫 번째 컨테이너도 확장 */
.navbar + .container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* 모든 페이지의 메인 컨테이너 확장 */
.container.mt-3,
.container.mt-3.mt-md-4,
.container.mt-3.mt-md-5 {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* 로그인/회원가입 페이지의 컨테이너 내부 row 확장 */
.container.mt-3.mt-md-5 .row,
.container.mt-3.mt-md-5 .row.justify-content-center {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    min-height: 0;
}

/* 네비게이션 바 개선 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    box-shadow: var(--shadow-lg);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 컨테이너 스타일 */
.container {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in;
}

/* body의 직접 자식인 컨테이너는 flex 확장 */
body > .container {
    flex: 1 0 auto;
}

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

/* 카드 스타일 개선 */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 1.25rem;
    font-weight: 600;
}

/* 버튼 스타일 개선 */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    border: none;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 폼 스타일 개선 */
.form-control {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* 일기 목록 스타일 */
.list-group-item {
    border: none;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    padding: 1.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid var(--primary-color);
}

.list-group-item:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    transform: translateX(10px) translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-left-width: 6px;
}

.list-group-item h5 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.list-group-item:hover h5 {
    color: var(--primary-color);
}

.list-group-item .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.list-group-item p {
    color: var(--text-light);
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* 일기 내용 영역 */
.diary-content {
    color: var(--text-color);
    line-height: 2.2;
    font-size: 1.15rem;
    padding: 1rem 0;
}

.diary-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.diary-content img:hover {
    transform: scale(1.02);
}

.diary-content p {
    margin-bottom: 1.75rem;
    text-align: justify;
}

.diary-content h1 {
    color: var(--primary-dark);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    font-size: 2.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.diary-content h2 {
    color: var(--primary-dark);
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

.diary-content h3 {
    color: var(--primary-dark);
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.5rem;
}

.diary-content blockquote {
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 0 12px 12px 0;
    box-shadow: var(--shadow-sm);
}

.diary-content code {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #e5e7eb 100%);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    color: var(--primary-dark);
    font-weight: 600;
}

.diary-content pre {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #f3f4f6;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-lg);
    margin: 2rem 0;
}

.diary-content pre code {
    background: transparent;
    color: #f3f4f6;
    padding: 0;
}

.diary-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
    border-radius: 12px;
    overflow: hidden;
}

.diary-content table th,
.diary-content table td {
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.diary-content table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    text-align: left;
}

.diary-content table tr:nth-child(even) {
    background: var(--secondary-color);
}

.diary-content table tr:hover {
    background: #f0f4ff;
}

.diary-content ul,
.diary-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.diary-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.diary-content a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.diary-content a:hover {
    color: var(--primary-dark);
}

/* Summernote 에디터 스타일 */
.note-editor {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.note-editor.note-frame {
    border: 2px solid var(--border-color);
}

.note-editor.note-frame .note-editing-area {
    background: white;
}

.note-toolbar {
    background: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
}

/* 알림 스타일 */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
}

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

.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* 푸터 스타일 - 항상 화면 하단에 고정 */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    color: white;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    width: 100%;
    flex-shrink: 0;
    flex: 0 0 auto;
}

/* body의 직접 자식인 footer 확실히 하단 고정 */
body > footer {
    margin-top: auto !important;
    margin-bottom: 0 !important;
}

/* Bootstrap의 mt-5 클래스 무시 */
footer.mt-5 {
    margin-top: auto !important;
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        border-radius: 16px;
        margin-top: 1rem;
    }
    
    .card {
        border-radius: 12px;
    }
    
    .list-group-item {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* 로딩 애니메이션 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 스크롤바 스타일 (웹킷 브라우저) */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 선택 효과 */
::selection {
    background: var(--primary-light);
    color: white;
}

/* 빈 상태 스타일 */
.text-center.py-5 {
    padding: 4rem 2rem !important;
}

.text-center.py-5 h3 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* 배지 스타일 개선 */
.badge {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

/* 링크 스타일 개선 */
a.text-decoration-none {
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

a.text-decoration-none:hover {
    color: var(--primary-dark);
    text-decoration: underline !important;
}

/* 폼 그룹 스타일 */
.mb-3 {
    margin-bottom: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

/* 제목 스타일 개선 */
h2.gradient-text {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* 카드 본문 패딩 개선 */
.card-body {
    padding: 2rem !important;
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem !important;
    }
}

/* 입력 필드 플레이스홀더 스타일 */
::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* 날짜 입력 필드 스타일 */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 그라데이션 텍스트 효과 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 호버 효과가 있는 아이콘 */
.icon-hover {
    transition: transform 0.3s ease;
}

.icon-hover:hover {
    transform: scale(1.2) rotate(5deg);
}

