/* Diary Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

textarea {
    width: 100%;
    min-height: 220px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 1.1rem;
    resize: vertical;
    transition: all 0.3s ease;
    outline: none;
}

textarea:focus {
    background: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    border-color: #c7d2fe;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

#voice-btn.recording {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

/* Response Section */
.response-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.response-box {
    background: rgba(241, 245, 249, 0.8);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    color: #475569;
    font-size: 1.05rem;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
}

.response-box.loading::after {
    content: attr(data-loading-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 500;
    color: #6366f1;
}

/* History Section */
.history-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px dashed rgba(99, 102, 241, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-weight: 500;
    text-align: left;
}

#total-diary-count {
    color: #6366f1;
    font-weight: 700;
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.delete-history-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.delete-history-btn:hover {
    background: #fff5f5;
    color: #ef4444;
    opacity: 1;
}

.card-diary {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 3px solid #e2e8f0;
}

.card-ai {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    color: #475569;
}

.card-ai-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .card-header {
        margin-bottom: 15px !important;
    }

    .card-date {
        font-size: 0.9rem !important;
    }

    .delete-history-btn {
        width: 28px !important;
        height: 28px !important;
    }

    .history-header h2 {
        font-size: 1.2rem;
    }
}
