:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --danger-color: #ff4d4d;
    --success-color: #28a745;
    --bg-overlay: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --text-color: #333;
    --border-radius: 12px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    background-image: url('https://images.unsplash.com/photo-1470770841072-f978cf4d019e?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: -1;
}

.container {
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 1000px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 30px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.header-right button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.2s;
}

.header-right button:hover {
    background: var(--primary-color);
    color: white;
}

main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
}

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

.day-name {
    text-align: center;
    font-weight: 600;
    color: var(--secondary-color);
    padding-bottom: 10px;
}

.calendar-days {
    display: contents;
}

.day {
    aspect-ratio: 1/1;
    background: white;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    border: 1px solid #eee;
    overflow: hidden;
}

.day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.day.today {
    border: 2px solid var(--primary-color);
    background: #f0f7ff;
}

.day.empty {
    background: transparent;
    cursor: default;
    border: none;
}

.day-num {
    font-weight: 600;
    font-size: 0.9rem;
}

.appt-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 4px;
}

.appt-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.sidebar-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sidebar-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 5px;
}

.categories-list {
    margin-bottom: 15px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.cat-color-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: 0.2s;
}

.btn.primary { background: var(--primary-color); color: white; }
.btn.secondary { background: var(--secondary-color); color: white; width: 100%; }
.btn.danger { background: var(--danger-color); color: white; }

.btn:hover { opacity: 0.9; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

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

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Appointment shading */
.day.shaded {
    background-color: rgba(0,0,0,0.05);
}

.day-appointments {
    margin-top: 5px;
    font-size: 0.75rem;
}

.appt-snippet {
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #444;
}

@media (max-width: 850px) {
    main { grid-template-columns: 1fr; }
    .container { padding: 15px; }
}
