:root {
    --primary: #8b5cf6;
    --secondary: #c4b5fd;
    --bg-light: #faf8f5;
    --bg-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --text-dark: #f5f5f5;
}

.light {
    --primary: #8b5cf6;
    --secondary: #c4b5fd;
    --bg-light: #faf8f5;
    --bg-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --text-dark: #f5f5f5;
}

.dark {
    --primary: #c4b5fd;
    --secondary: #8b5cf6;
    --bg-light: #faf8f5;
    --bg-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --text-dark: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.8;
    overflow-x: hidden;
}

.nav-link {
    color: var(--text-light);
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.dark .nav-link {
    color: var(--text-dark);
}

.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.dark .card {
    background: rgba(40, 40, 40, 0.7);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 22px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.dark .input-field {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: var(--text-dark);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.input-field {
    resize: vertical;
    min-height: 120px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-light);
    border-radius: 20px;
    padding: 32px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content.dark,
.dark .modal-content {
    background: var(--bg-dark);
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header {
    text-align: center;
    padding: 40px 0;
}

.page-header h1 {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.page-header p {
    opacity: 0.7;
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#flower-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.flower {
    position: absolute;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        opacity: 1;
        transform: translateY(-10px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(360deg);
    }
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

.image-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .delete-btn {
    opacity: 1;
}

.record-item {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.dark .record-item {
    background: rgba(40, 40, 40, 0.6);
}

.record-item:hover {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.1);
}

.record-date {
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 8px;
}

.record-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--secondary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark .checkbox-wrapper {
    background: rgba(50, 50, 50, 0.5);
}

.checkbox-wrapper:hover {
    background: rgba(139, 92, 246, 0.1);
}

.checkbox-wrapper.checked {
    opacity: 0.6;
}

.checkbox-wrapper.checked .wish-content {
    text-decoration: line-through;
}

.wish-content {
    flex: 1;
}

.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.dark .password-modal {
    background: var(--bg-dark);
}

.password-box {
    text-align: center;
    padding: 40px;
}

.password-box h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 30px;
}

.password-box input {
    margin-bottom: 20px;
}

.password-error {
    color: #ef4444;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-error.show {
    opacity: 1;
}

.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.photo-viewer.active {
    opacity: 1;
    visibility: visible;
}

.photo-viewer img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.photo-viewer .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.photo-viewer .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .modal-content {
        padding: 20px;
    }
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.dark ::-webkit-scrollbar-thumb {
    background: #4a4a4a;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6a6a6a;
}

.mood-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.duration-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-light);
}

.dark .form-group label {
    color: var(--text-dark);
}

.wish-tab {
    display: inline-flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.dark .wish-tab {
    background: rgba(50, 50, 50, 0.5);
}

.wish-tab button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wish-tab button.active {
    background: var(--primary);
    color: white;
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.hidden {
    display: none !important;
}

.progress-bar-container {
    position: relative;
    height: 20px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.dark .progress-bar-container {
    background: rgba(196, 181, 253, 0.1);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out, background 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-glow {
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    bottom: -5px;
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.3), rgba(236, 72, 153, 0.1));
    border-radius: 15px;
    opacity: 0.5;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.progress-slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.progress-slider::-webkit-slider-track {
    height: 8px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 4px;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.progress-slider::-moz-range-track {
    height: 8px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 4px;
}

.progress-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dark .progress-slider::-webkit-slider-track {
    background: rgba(196, 181, 253, 0.2);
}

.dark .progress-slider::-moz-range-track {
    background: rgba(196, 181, 253, 0.2);
}