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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 40px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

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

.month-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.month-navigation h2 {
    font-size: 24px;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    padding: 40px;
    display: flex;
    gap: 30px;
}

.calendar-view {
    flex: 1;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.day-name {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    min-height: 600px;
}

.calendar-day {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px;
    min-height: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.calendar-day:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.calendar-day.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
}

.day-number {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.day-entries {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 80px;
    overflow: hidden;
}

.entry-dot {
    width: 100%;
    border-radius: 3px;
    transition: all 0.2s ease;
    min-height: 3px;
}

.entry-dot.work { background: #3b82f6; }
.entry-dot.personal { background: #8b5cf6; }
.entry-dot.health { background: #10b981; }
.entry-dot.social { background: #f59e0b; }
.entry-dot.finance { background: #ef4444; }
.entry-dot.other { background: #6b7280; }

.entry-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.bulk-modal {
    max-width: 600px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.textarea {
    min-height: 100px;
    resize: vertical;
}

/* Color Picker Styles */
.color-picker-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.color-preset {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.color-preset.selected {
    border-color: var(--text-primary);
    transform: scale(1.05);
}

.color-preset.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.custom-color-input {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.custom-color-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

#entryColor {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#entryColor:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Bulk Entry Styles */
.date-range-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.small-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
}

.weekday-selector {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.weekday-buttons {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.weekday-btn {
    padding: 10px 5px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.weekday-btn:hover {
    border-color: var(--primary-light);
    background: var(--bg-tertiary);
}

.weekday-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.helper-text {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
}

.day-panel-footer .btn {
    width: 100%;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Day Panel */
.day-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    transition: right 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.day-panel.active {
    right: 0;
}

.day-panel-header {
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-panel-header h3 {
    font-size: 24px;
    font-weight: 700;
}

.day-panel-header .btn-close {
    color: white;
}

.day-panel-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.day-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
}

.entry-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.entry-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(-5px);
}

.entry-card.work { border-left-color: #3b82f6; }
.entry-card.personal { border-left-color: #8b5cf6; }
.entry-card.health { border-left-color: #10b981; }
.entry-card.social { border-left-color: #f59e0b; }
.entry-card.finance { border-left-color: #ef4444; }
.entry-card.other { border-left-color: #6b7280; }

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

.entry-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    flex: 1;
}

.entry-actions {
    display: flex;
    gap: 5px;
}

.btn-icon-small {
    width: 30px;
    height: 30px;
    padding: 0;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-icon-small:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.entry-time {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.entry-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.entry-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.entry-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.entry-badge.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.entry-badge.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.entry-badge.priority-low {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.entry-badge.category {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.day-panel-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
}

.day-panel-footer .btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.day-panel-footer .btn span {
    font-size: 20px;
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .day-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .month-navigation h2 {
        font-size: 18px;
        min-width: 150px;
    }

    .main-content {
        padding: 20px;
    }

    .calendar-day {
        min-height: 80px;
        padding: 8px;
    }

    .day-number {
        font-size: 14px;
    }

    .modal-content {
        width: 95%;
    }
}
