/* styles/calendar.css */

/* =========================================
   APPLE DESIGN SYSTEM (Variabile & Reset)
   ========================================= */
   
:root {
    --bg-body: #F5F5F7; /* Apple Off-White */
    --bg-card: #FFFFFF;
    --border-subtle: #F0F0F0; /* Very light border */
    --border-focus: #007AFF; /* Apple Blue */
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.04);
    --shadow-float: 0 10px 40px rgba(0,0,0,0.08);
    --radius-app: 18px;
    --radius-btn: 12px;
}

body {
    background-color: var(--bg-body);
    /* Forțăm fonturile de sistem pentru aspectul nativ Mac */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 3rem; /* pb-12 echivalent */
}

/* --- Layout & Glassmorphism Header --- */
.glass-header {
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem; /* px-6 py-4 */
    margin-bottom: 2rem; /* mb-8 */
}

.calendar-container {
    background: var(--bg-card);
    border-radius: var(--radius-app);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.02);
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* --- Grid System Refined --- */
.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #FAFAFA;
    border-bottom: 1px solid var(--border-subtle);
}

.calendar-header-cell {
    padding: 14px 0;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-secondary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: var(--border-subtle); /* Defines grid lines via gap */
    gap: 1px; /* The gap creates the thin lines */
}

.calendar-day {
    background-color: white;
    min-height: 160px;
    padding: 10px;
    position: relative;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-day:hover {
    background-color: #FAFAFA;
}

/* --- Typography & Elements --- */
.day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 4px;
}

.day-number.today {
    background: #FF3B30; /* Apple Red for Today */
    color: white;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
}

.day-number.other-month {
    opacity: 0.25;
}

/* --- Soft UI Pills (Apple Style) --- */
.event-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border-left: 3px solid transparent;
}

.event-pill:hover {
    transform: scale(1.02) translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 10;
}

/* Modern Colors: Light bg + Dark text */
.pill-blue { background-color: #E6F2FF; color: #007AFF; border-left-color: #007AFF; }
.pill-purple { background-color: #F2E6FF; color: #AF52DE; border-left-color: #AF52DE; }
.pill-green { background-color: #E6FFEC; color: #34C759; border-left-color: #34C759; }
.pill-orange { background-color: #FFF2E6; color: #FF9500; border-left-color: #FF9500; }
.pill-gray { background-color: #F2F2F7; color: #8E8E93; border-left-color: #8E8E93; }

/* --- Controls & Inputs --- */
.ios-btn {
    background: var(--text-primary);
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius-btn);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
}
.ios-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ios-btn:active { transform: scale(0.97); }

.ios-btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid #E5E5E5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.ios-btn-secondary:hover { background: #F9FAFB; border-color: #D1D5DB; }

.ios-input {
    background: #F2F2F7; /* iOS Input Gray */
    border: 1px solid transparent;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: all 0.2s;
    color: var(--text-primary);
}
.ios-input:focus {
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1); /* Blue focus ring */
}

/* --- Modal Animation (Physics-based) --- */
#modal-wrapper { transition: opacity 0.3s ease; }
#modal-content { 
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy effect */
    box-shadow: var(--shadow-float);
    border-radius: 24px;
}

.modal-enter { opacity: 0; transform: scale(0.9) translateY(10px); }
.modal-active { opacity: 1; transform: scale(1) translateY(0); }