/* =====================================================
   Weekly Reflections Enhanced Styles
   ===================================================== */

/* Reflection Section Container */
.reflection-section-enhanced {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--rose-gold, #E8B4B8);
}

/* Reflection Header */
.reflection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.reflection-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--navy, #6B4E71);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reflection-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: var(--cream, #FAF8F5);
    border: 2px solid var(--lavender, #B8A9C9);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--navy, #6B4E71);
}

.btn-icon:hover {
    background: var(--lavender, #B8A9C9);
    color: white;
    transform: translateY(-2px);
}

.btn-icon i {
    font-size: 1rem;
}

/* Reflection Input */
.reflection-input-container {
    margin-bottom: 1.5rem;
}

.reflection-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s ease;
}

.reflection-textarea:focus {
    outline: none;
    border-color: var(--lavender, #B8A9C9);
    box-shadow: 0 0 0 4px rgba(184, 169, 201, 0.1);
}

.reflection-textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Reflection Status */
.reflection-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.status-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-typing {
    color: #999;
}

.status-typing::before {
    content: '✎';
    font-size: 1rem;
}

.status-saving {
    color: var(--lavender, #B8A9C9);
}

.status-saving::before {
    content: '⏳';
    animation: pulse 1s ease-in-out infinite;
}

.status-saved {
    color: var(--sage-green, #81C784);
}

.status-saved::before {
    content: '✓';
    font-size: 1.2rem;
}

.status-error {
    color: #e57373;
}

.status-error::before {
    content: '⚠';
    font-size: 1rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.char-count {
    color: #999;
}

/* Reflection History */
.reflection-history {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

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

.history-header h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--navy, #6B4E71);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--lavender, #B8A9C9);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-text:hover {
    color: var(--navy, #6B4E71);
}

.btn-text i {
    transition: transform 0.3s ease;
}

/* History Content */
.history-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
}

.history-loading,
.history-empty,
.history-error {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-style: italic;
}

.history-loading i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.history-error {
    color: #e57373;
}

/* History Entry */
.history-entry {
    background: var(--cream, #FAF8F5);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #e0e0e0;
    transition: all 0.3s ease;
}

.history-entry:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.history-entry.current {
    border-left-color: var(--sage-green, #81C784);
    background: linear-gradient(135deg, rgba(129, 199, 132, 0.1) 0%, transparent 100%);
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.history-date {
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-badge {
    background: var(--sage-green, #81C784);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Scrollbar Styling */
.history-content::-webkit-scrollbar {
    width: 8px;
}

.history-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb {
    background: var(--lavender, #B8A9C9);
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb:hover {
    background: var(--navy, #6B4E71);
}

/* Responsive Design */
@media (max-width: 768px) {
    .reflection-section-enhanced {
        padding: 1rem;
    }

    .reflection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .reflection-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .reflection-textarea {
        min-height: 120px;
        font-size: 0.9rem;
    }

    .history-entry {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .reflection-header h3 {
        font-size: 1.25rem;
    }

    .history-header h4 {
        font-size: 1.1rem;
    }

    .btn-icon {
        padding: 0.4rem;
    }

    .reflection-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
