:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #3b82f6;
    --danger-color: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

header p {
    color: var(--text-muted);
}

.recording-section {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

#cat-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--accent);
}

#cat-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.recording-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.status-message {
    font-size: 1.1rem;
    color: var(--text-muted);
    min-height: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.action-btn {
    appearance: none;
    border: none;
    color: white;
    padding: 1rem 1rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    white-space: nowrap;
}

.action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.record-btn.start {
    background: var(--primary-color);
    box-shadow: 0 4px 6px -1px var(--primary-color);
}

.record-btn.stop {
    background: var(--danger-color);
    box-shadow: 0 4px 6px -1px var(--danger-color);
}

.action-btn.upload {
    background: #475569;
    box-shadow: 0 4px 6px -1px #475569;
    color: white;
}

/* 마이크 아이콘 모양 CSS 변수 활용 */
.icon-mic {
    width: 24px;
    height: 24px;
    background-color: currentColor;
    mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 14C13.6569 14 15 12.6569 15 11V5C15 3.34315 13.6569 2 12 2C10.3431 2 9 3.34315 9 5V11C9 12.6569 10.3431 14 12 14Z" fill="white"/><path d="M19 11C19 14.866 15.866 18 12 18C8.13401 18 5 14.866 5 11H3C3 15.4183 6.13615 19.0827 10.3 19.8249V23H13.7V19.8249C17.8638 19.0827 21 15.4183 21 11H19Z" fill="white"/></svg>') no-repeat center / contain;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 14C13.6569 14 15 12.6569 15 11V5C15 3.34315 13.6569 2 12 2C10.3431 2 9 3.34315 9 5V11C9 12.6569 10.3431 14 12 14Z" fill="white"/><path d="M19 11C19 14.866 15.866 18 12 18C8.13401 18 5 14.866 5 11H3C3 15.4183 6.13615 19.0827 10.3 19.8249V23H13.7V19.8249C17.8638 19.0827 21 15.4183 21 11H19Z" fill="white"/></svg>') no-repeat center / contain;
}

.meetings-section h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--surface-color);
    padding-bottom: 0.5rem;
}

.meetings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meeting-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.meeting-card:hover {
    transform: translateY(-2px);
    background-color: #2a3b54;
}

.meeting-card h3 {
    margin-bottom: 0.25rem;
    pointer-events: none;
}

.meeting-card .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* 이제 목록에서는 세부내용 숨김 */
.meeting-card .report {
    display: none;
}

/* Modal Styles */
.modal {
    display: flex;
    /* hidden 처리 시 덮어쓰기 필요할 수 있음. JS로 관리 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--surface-color);
    margin: auto;
    padding: 2rem;
    border: 1px solid #334155;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.close-btn {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-btn:hover,
.close-btn:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
    margin-top: 10px;
}

.modal-header h3 {
    font-size: 1.4rem;
}

.edit-btn,
.save-btn {
    background-color: #475569;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.edit-btn:hover,
.save-btn:hover {
    background-color: #64748b;
}

#edit-title-container {
    display: flex;
    gap: 5px;
}

#edit-title-input {
    background: #0f172a;
    border: 1px solid #475569;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: inherit;
    width: 100%;
}

.modal .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.modal .report {
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
    word-break: break-all;
    /* 영어 등 긴 단어 강제 줄바꿈 */
    overflow-wrap: break-word;
    /* 레이아웃을 깨지 않도록 줄바꿈 허용 */
}