/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #faf5ff;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-in;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Header Section */
header {
    background-color: #fff;
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.6s ease-out;
}

header h1 {
    font-size: 42px;
    color: #9333ea;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Main Container */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Card Styles */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: slideUp 0.5s ease-out;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Form Styles */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
    transition: color 0.2s ease;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #9333ea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #d0d0d0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group textarea {
    resize: vertical;
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: #9333ea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(147, 51, 234, 0.2);
}

.btn-primary:hover {
    background-color: #7e22ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(147, 51, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(147, 51, 234, 0.2);
}

/* Summary Section */
.summary-section {
    margin-bottom: 40px;
    animation: slideUp 0.6s ease-out 0.2s both;
}

.summary-section h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 24px;
    font-weight: 600;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.summary-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    animation: scaleIn 0.5s ease-out backwards;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.2s; }
.summary-card:nth-child(3) { animation-delay: 0.3s; }
.summary-card:nth-child(4) { animation-delay: 0.4s; }

.summary-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.15);
}

.summary-value {
    font-size: 36px;
    font-weight: 700;
    color: #9333ea;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.summary-card:hover .summary-value {
    transform: scale(1.1);
    color: #7e22ce;
}

.summary-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

/* History Section */
.history-section h2 {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    animation: slideDown 0.5s ease-out 0.3s both;
}

.btn-secondary {
    padding: 10px 18px;
    background-color: #fff;
    color: #666;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #d0d0d0;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-danger {
    padding: 10px 20px;
    background-color: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Filter Section */
.filter-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 24px;
    animation: slideDown 0.5s ease-out 0.4s both;
    transition: all 0.3s ease;
}

.filter-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
    transition: color 0.2s ease;
}

.filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #9333ea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.filter-group select:hover {
    border-color: #d0d0d0;
}

.no-entries {
    background-color: #fff;
    border-radius: 12px;
    padding: 50px 40px;
    text-align: center;
    color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: scaleIn 0.5s ease-out;
    font-size: 15px;
}

.entry-item {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    animation: slideUp 0.4s ease-out backwards;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.entry-item:nth-child(1) { animation-delay: 0.05s; }
.entry-item:nth-child(2) { animation-delay: 0.1s; }
.entry-item:nth-child(3) { animation-delay: 0.15s; }
.entry-item:nth-child(4) { animation-delay: 0.2s; }
.entry-item:nth-child(5) { animation-delay: 0.25s; }

.entry-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
    border-left-color: #9333ea;
}

.entry-delete-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 14px;
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
}

.entry-item:hover .entry-delete-btn {
    opacity: 1;
}

.entry-delete-btn:hover {
    background-color: #fecaca;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.entry-delete-btn:active {
    transform: scale(0.98);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f5f5f5;
    transition: border-color 0.3s ease;
}

.entry-item:hover .entry-header {
    border-bottom-color: #e9d5ff;
}

.entry-date {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    transition: color 0.3s ease;
}

.entry-item:hover .entry-date {
    color: #9333ea;
}

.entry-category {
    display: inline-block;
    padding: 5px 14px;
    background-color: #e9d5ff;
    color: #9333ea;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.entry-item:hover .entry-category {
    background-color: #9333ea;
    color: #fff;
    transform: scale(1.05);
}

.entry-topic {
    font-size: 17px;
    color: #333;
    margin-bottom: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.entry-item:hover .entry-topic {
    color: #9333ea;
}

.entry-stats {
    display: flex;
    gap: 28px;
    margin-bottom: 12px;
}

.entry-stat {
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.entry-stat strong {
    color: #9333ea;
    font-weight: 700;
    font-size: 16px;
    transition: color 0.3s ease;
}

.entry-item:hover .entry-stat strong {
    color: #7e22ce;
}

.entry-notes {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    margin-top: 14px;
    padding: 14px 16px;
    background-color: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #9333ea;
    transition: all 0.3s ease;
}

.entry-item:hover .entry-notes {
    background-color: #f3f4f6;
    border-left-color: #7e22ce;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 16px;
    padding: 36px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.4s ease-out;
    transform-origin: center;
}

.modal-content h3 {
    margin-bottom: 18px;
    color: #333;
    font-size: 22px;
    font-weight: 700;
}

.modal-content p {
    margin-bottom: 28px;
    color: #666;
    line-height: 1.7;
    font-size: 15px;
}

.modal-actions {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-actions button:hover {
    transform: translateY(-1px);
}

.modal-actions button:active {
    transform: translateY(0);
}