* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd8;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    --text: #2d3748;
    --text-light: #718096;
    --background: #f7fafc;
    --white: #ffffff;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--white);
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Action Bar */
.action-bar {
    margin-bottom: 24px;
    text-align: center;
}

/* Entries Section */
.entries-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.entries-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
    text-align: center;
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Entry Card */
.entry-card {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
}

.entry-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.entry-title {
    font-weight: 700;
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

.entry-date {
    color: var(--text-light);
    font-size: 0.875rem;
    text-align: right;
    min-width: 150px;
}

.entry-content {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.entry-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: var(--gray-300);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--gray-400);
}

.btn-edit {
    background: linear-gradient(135deg, var(--warning), #dd6b20);
    color: var(--white);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-delete {
    background: linear-gradient(135deg, var(--error), #e53e3e);
    color: var(--white);
    padding: 8px 16px;
    font-size: 13px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

input, textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--white);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input {
    height: 52px;
}

textarea {
    height: 200px;
    resize: vertical;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    margin-bottom: 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

/* States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-style: italic;
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    border-left: 4px solid var(--error);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text);
}

.empty-state p {
    font-size: 1rem;
    line-height: 1.5;
}

/* Message Toast */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: var(--radius);
    z-index: 1100;
    font-weight: 600;
    text-align: center;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

.message.success {
    background: var(--success);
    color: white;
}

.message.error {
    background: var(--error);
    color: white;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .entries-section {
        padding: 20px;
    }
    
    .entry-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .entry-date {
        text-align: left;
    }
    
    .entry-actions {
        justify-content: stretch;
    }
    
    .entry-actions .btn {
        flex: 1;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 20px 20px 0;
    }
    
    .modal-body {
        padding: 20px;
    }
}

