@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300&display=swap');
@import url('https://cdn.jsdelivr.net/gh/eunchurn/NanumSquareNeo@0.0.6/nanumsquareneo.css');

:root {
    /* Light Mode (Default) */
    --primary: #00897B;
    /* Smart Teal - Reassurance & Solution */
    --primary-light: #4DB6AC;
    --secondary: #004D40;
    /* Deep Green - Stability */
    --accent: #1976D2;
    /* Trust Blue - Evidence & CTA */
    --bg-body: #F5F7FA;
    /* Clean White/Gray - Smart & Automation */
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #2C3E50;
    /* Modern Dark Gray */
    --text-sub: #7F8C8D;
    --border: #E0E0E0;
    --success: #27AE60;
    /* Green Check */
    --danger: #E74C3C;
    /* Red - Warning only */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 9px;
    --radius-lg: 12px;

    --font-body: 'Kanit', 'NanumSquareNeo', sans-serif;
}

[data-theme="dark"] {
    --primary: #26A69A;
    /* Lighter Teal for Dark Mode */
    --primary-light: #80CBC4;
    --secondary: #00695C;
    --accent: #42A5F5;
    /* Lighter Blue */
    --bg-body: #263238;
    /* Dark Blue-Gray */
    --bg-surface: #37474F;
    --bg-sidebar: #37474F;
    --text-main: #ECEFF1;
    --text-sub: #B0BEC5;
    --border: #546E7A;
    --success: #2ECC71;
    --danger: #EF5350;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* font-size: 18px; Removed base size dependency */
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6em;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}
input, textarea, select, option, button {font-family: var(--font-body);}
a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px;
    min-height: 100vh;
    position: relative;
    transition: background-color 0.3s;
    padding-bottom: 160px;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.03em;
}

h1 {
    font-size: 1.5rem;
    color: var(--text-main);
}

/* 22px */
h2 {
    font-size: 1.125rem;
    margin-bottom: 10px;
}

/* 18px */
h3 {
    font-size: 1rem;
    color: var(--text-main);
}

/* 16px */
p {
    font-size: 0.825rem;
    color: var(--text-sub);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    gap: 6px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 137, 123, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 137, 123, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
}

.btn-outline:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    margin-top: 5px;
    padding: 12px;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
}
header .btn-icon {
    padding: 0;
    margin-top: 0;
    font-size: large;
}
.timeline-content .btn-icon {
    background: rgba(0, 0, 0, 0.02);
}
.card-actions .btn-icon {
    font-size: 1.2rem;
    padding: 0 0 12px 0;
}
.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Inputs */
.form-control {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.825rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-sub);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    margin-top: 8px;
}

/* Quote Card Style */
.quote-card {
    background: var(--bg-body);
    border: 1px dashed var(--border);
    padding: 16px;
    border-radius: var(--radius-sm);
}

.quote-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.quote-total {
    border-top: 1px dashed var(--border);
    margin-top: 10px;
    padding-top: 10px;
    text-align: right;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-heading);
}

/* Action Bar */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 100;
}

[data-theme="dark"] .action-bar {
    background: rgba(47, 54, 64, 0.9);
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: nowrap;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.825rem;
    color: var(--text-sub);
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
    transition: all 0.2s;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.action-btn.active {
    color: var(--primary);
    font-weight: 700;
    background: rgba(95, 39, 205, 0.05);
}

.action-btn span {
    font-size: 1.5rem;
}

/* FAB */
.fab {
    bottom: 30px;
    right: 30px;
    width: 72px !important;
    height: 72px !important;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
    position: fixed;
    z-index: 90;
}

.fab:hover {
    transform: scale(1.05) rotate(90deg);
}

/* Sidebar & Navigation */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-sidebar);
    z-index: 950;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 700;
    margin-left: 12px;
    margin-top: 8px;
}
.sidebar-logo img {width:2.3rem;margin-left:-6px;vertical-align:middle;}

.nav-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: background 0.2s;
    font-family: var(--font-heading);
}

.nav-item:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(95, 39, 205, 0.1);
    color: var(--primary);
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

/* Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: var(--bg-surface);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}

/* Timeline Specifics */
.timeline-container {
    padding-bottom: 160px;
    /* Space for fixed action bar */
    position: relative;
}

.timeline {
    position: relative;
    padding-left: 24px;
    margin-top: 16px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--primary-light);
    z-index: 1;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 4px;
    font-weight: 600;
}

.timeline-content {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
}

.timeline-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

/* Quote Card in Timeline */
.timeline-quote {
    background: linear-gradient(to right bottom, var(--bg-surface), rgba(95, 39, 205, 0.03));
    border: 1px solid var(--primary-light);
}

.timeline-quote .quote-total {
    color: var(--primary);
    border-top: 1px dashed var(--primary-light);
}

/* Timeline Items Layout */
.timeline-items {
    position: relative;
    padding: 32px 0 32px 16px;
    max-width: 768px;
    margin: 0 auto;
}

.timeline-items::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-items>.timeline-content {
    position: relative;
    margin-bottom: 32px;
    overflow-wrap: break-word;
}

.timeline-items>.timeline-content::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 26px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--primary-light);
    z-index: 1;
}

/* Fix quote icons overlapping text */
.timeline-quote>div:first-child {
    margin-top: 0 !important;
    right: 8px !important;
}

#textInputArea button {
    white-space: nowrap;
}

/* Modern Hero Section */
.landing-hero {
    text-align: center;
    padding: 24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 137, 123, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.landing-title {
    font-size: 1.4rem;
    line-height: 1.3em;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.landing-subtitle {
    color: var(--text-sub);
    margin-bottom: 40px;
    line-height: 1.8em;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature Cards Redesign */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 24px;
    display: inline-block;
    padding: 16px;
    background: rgba(0, 137, 123, 0.05);
    border-radius: 50%;
    color: var(--primary);
    transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(0, 137, 123, 0.1);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.feature-card p {
    color: var(--text-sub);
    line-height: 1.7em;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FontAwesome Integration Tweaks */
.btn-icon i {
    pointer-events: none;
}

.nav-icon i {
    width: 24px;
    text-align: center;
}

.fab i {
    pointer-events: none;
}

.feature-icon i {
    color: var(--primary);
}

/* Spinner & Custom Confirm */
@keyframes rotate_loading {
    100% {
        transform: rotate(360deg);
    }
}

.cover-all-in-progress {
    z-index: 300;
    background-color: #000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.result-message {
    z-index: 405;
    position: absolute;
    top: calc(50% - 100px);
    left: calc(50% - 170px);
    width: 340px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    text-align: left;
    display: none;
}

.result-message button {
    position: absolute;
    bottom: 20px;
    padding: 5px 20px;
    margin-right: 5px;
    border: 0;
    border-radius: 5px;
    width: 90px;
    cursor: pointer;
    background-color: #888;
    color: #fff;
}

.result-message button:first-child {
    right: 114px;
    background-color: #808000;
}

.result-message button:last-child {
    right: 20px;
}

.result-message button:hover {
    background-color: #333;
}

@keyframes spinning {
    to {
        transform: rotate(1turn);
    }
}

.spinner-box {
    z-index: 999998;
    position: fixed;
    top: calc(50% - 100px);
    left: calc(50% - 150px);
    width: 300px;
    border: 3px solid transparent;
    border-radius: 20px;
    background-color: #fff;
    text-align: center;
    color: #555;
    padding: 30px;
    line-height: 1.3em;
}

.spinner {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    line-height: 1.4em;
}

.spinner::after {
    content: '';
    width: 80px;
    height: 80px;
    border: 20px solid #dddddd;
    border-top-color: #00ced1;
    border-radius: 50%;
    animation: spinning 1s ease infinite;
}

/* Extracted from index.jsp */
.header-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.hero-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 24px;
}

.hero-cta-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
}

.hero-cta-btn {
    padding: 16px 40px;
    font-weight: 700;
    border-radius: 32px;
}

.icon-sm {
    font-size: 0.825em;
}

.footer-text {
    line-height: 1.6em;
}

/* Extracted from timeline.jsp */
.timeline-edit-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 2px;
}

.timeline-timestamp {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.timeline-photo {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

.timeline-audio {
    width: 100%;
    margin-bottom: 8px;
}

.timeline-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-sub);
}

.voice-input-area {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.recording-status {
    font-weight: 600;
    color: var(--primary);
}

.btn-record {
    border-radius: 50%;
    width: 64px;
    height: 64px;
    padding: 0;
    font-size: 1.5rem;
}

.btn-record-stop {
    color: var(--danger);
    border-color: var(--danger);
}

.quote-input-area {
    display: none;
    gap: 8px;
    flex-direction: column;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Utilities */
.mt-2 {
    margin-top: 8px;
}

.mt-8 {
    margin-top: 32px;
}

.mb-2 {
    margin-bottom: 8px;
}

.flex-gap-2 {
    display: flex;
    gap: 8px;
}

.flex-gap-4 {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.w-full {
    width: 100%;
}

.justify-center {
    justify-content: center;
}

.text-main {
    color: var(--text-main);
}

.hidden {
    display: none;
}

/* Extracted from login.jsp */
.login-container {
    min-height: 100vh;
    padding: 32px;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-flow: column;
}

.login-card {
    background: var(--bg-surface);
    padding: 48px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 32px;
    display: inline-block;
}

.login-subtitle {
    color: var(--text-sub);
    margin-bottom: 40px;
}

.kakao-btn {
    background-color: #FEE500;
    color: #000000;
    border: none;
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.2s;
}

.kakao-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

.kakao-icon {
   width: 24px;
    vertical-align: middle;
}

.login-footer {
    margin-top: 32px;
    font-size: 0.825rem;
    color: var(--text-sub);
}

.text-underline {
    text-decoration: underline;
}

/* Extracted from list.jsp */
.content-wrapper {
    padding-bottom: 80px;
}

.page-title {
    margin-bottom: 24px;
    font-family: var(--font-heading);
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-sub);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.card-clickable {
    cursor: pointer;
    position: relative;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    margin-bottom: 8px;
    color: var(--primary);
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.icon-w-5 {
    width: 20px;
}

.text-danger {
    color: var(--danger);
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mt-4 {
    margin-top: 16px;
}

/* Extracted from sidebar.jsp */
.sidebar-label {
    font-size: 0.825rem;
    font-weight: 600;
}

.project-title {
    font-size: 0.825rem;
    opacity: 0.6;
    margin-left: 26px;
}
.project-title i {
    margin-right: 7px;
    width: 12px;
}
