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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #ff6b9d;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    gap: 30px;
}

section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #ff6b9d;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

input[type="text"],
input[type="date"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
    outline: none;
    border-color: #ff6b9d;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

input[type="file"] {
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b9d 0%, #ffa06b 100%);
    color: white;
    width: 100%;
    font-size: 1.1em;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-export {
    background: #4CAF50;
    color: white;
    margin-left: 10px;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.entries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.entries-container {
    display: grid;
    gap: 20px;
}

.diary-entry {
    border: 2px solid #ffe4e8;
    border-radius: 12px;
    padding: 25px;
    background: linear-gradient(135deg, #fff5f7 0%, #fff 100%);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.diary-entry:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.2);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.entry-title {
    font-size: 1.5em;
    color: #ff6b9d;
    font-weight: 700;
}

.entry-date {
    color: #666;
    font-size: 0.95em;
}

.entry-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.entry-meta span {
    color: #555;
    font-size: 0.95em;
}

.entry-meta strong {
    color: #ff6b9d;
}

.entry-content {
    color: #333;
    line-height: 1.7;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.entry-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.entry-images img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.entry-images img:hover {
    transform: scale(1.05);
}

.entry-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.no-entries {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 1.2em;
}

/* Modal for fullscreen images */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #ff6b9d;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .filter-controls {
        grid-template-columns: 1fr;
    }

    .entries-header {
        flex-direction: column;
        align-items: stretch;
    }

    .export-buttons {
        justify-content: stretch;
    }

    .btn-export {
        margin-left: 0;
        flex: 1;
    }

    .entry-images img {
        width: 150px;
        height: 150px;
    }
}

/* Print styles for PDF export */
@media print {
    body {
        background: white;
    }

    .add-entry-section,
    .filter-section,
    .entries-header {
        display: none;
    }

    .diary-entry {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
}
