/* Family Calendar Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 0.5rem;
    box-sizing: border-box;
}

.error {
    color: #ef4444;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    margin-bottom: 0.5rem;
}

.day-column {
    background: rgba(0,0,0, 0.3);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.weekend {
    background: rgba(0,0,0, 0.6);
}

.day-header {
    background: #333;
    text-align: center;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.day-name {
    font-weight: 900;
    color: #eee;
    text-transform: uppercase;
}

.day-date {
    font-weight: 100;
    color: #fff;
    margin-left: 0.25rem;
}

.all-day-events {
    min-height: 1rem;
    padding: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.all-day-event {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.all-day-event.past {
    opacity: 0.4;
    filter: grayscale(50%);
}

.spacer {
    height: 0.25rem;
    flex-shrink: 0;
}

.timed-events {
    flex-grow: 1;
    padding: .5rem;
    overflow-y: auto;
    min-height: 0;
}

.timed-event {
    border-radius: 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 1rem solid;
}

.timed-event:last-child {
    margin-bottom: 0;
}

.timed-event.past {
    opacity: 0.4;
    filter: grayscale(50%);
}

.event-title {
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.1;
}

.event-time {
    font-size: 0.75rem;
    opacity: 0.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.1;
}

/* Birthday Styles */
.birthday-header {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff) !important;
    background-size: 400% 400% !important;
    animation: birthdayGradient 3s ease infinite !important;
    position: relative;
    overflow: hidden;
}

.birthday-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: birthdayShine 2s ease-in-out infinite;
}

.birthday-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: birthdayBounce 2s ease-in-out infinite;
    z-index: 10;
    white-space: nowrap;
}

.birthday-emojis {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.birthday-emoji {
    position: absolute;
    font-size: 1.5rem;
    animation: birthdayFloat 4s ease-in-out infinite;
    opacity: 0.8;
}

.birthday-emoji:nth-child(1) { left: 10%; animation-delay: 0s; }
.birthday-emoji:nth-child(2) { left: 30%; animation-delay: 0.5s; }
.birthday-emoji:nth-child(3) { left: 50%; animation-delay: 1s; }
.birthday-emoji:nth-child(4) { left: 70%; animation-delay: 1.5s; }
.birthday-emoji:nth-child(5) { left: 90%; animation-delay: 2s; }

@keyframes birthdayGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes birthdayShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes birthdayBounce {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes birthdayFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    50% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-15px) rotate(3deg); }
}

/* Birthday Footer Styles */
.birthday-footer {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff);
    background-size: 400% 400%;
    animation: birthdayGradient 3s ease infinite;
    position: relative;
    overflow: hidden;
    height: 4rem;
    margin-top: auto;
    border-radius: 0 0 0.5rem 0.5rem;
}

.birthday-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: birthdayShine 2s ease-in-out infinite;
}

/* Today highlighting */
.today-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.5);
}

/* Inline Navigation */
.nav-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    flex-shrink: 0;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 25%;
}

.nav-right {
    justify-content: flex-end;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.current-time {
    font-weight: 900;
    color: #eee;
    text-transform: uppercase;
    font-size: 2rem;
    text-align: center;
}

/* Navigation Button Styles */
.nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: translateY(0);
}

/* Today Button Variant */
.nav-btn-today {
    display: flex;
}

/* Octicon Styling */
.octicon {
    fill: currentColor;
    flex-shrink: 0;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    min-height: 3rem;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 4rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    margin-right: 1rem;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Event Details Modal Styles */
.event-details-modal {
    max-width: 600px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.event-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    position: relative;
}

.event-title-large {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.event-datetime {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.datetime-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.datetime-icon .octicon {
    fill: rgba(255, 255, 255, 0.9);
}

.datetime-info {
    flex: 1;
}

.event-date {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.event-time {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.25rem 0 0 0;
}

.event-details-content {
    padding: 1.5rem 2rem 2rem;
    background: white;
}

.detail-section {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0;
    transition: all 0.2s ease;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
}

.detail-content {
    flex: 1;
    min-width: 0;
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-value {
    color: #212529;
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.description-text {
    white-space: pre-wrap;
}

.description-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.description-text a:hover {
    text-decoration: underline;
}

/* Close button styling for event details modal */
.event-details-modal .close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    right: 1.5rem;
    top: 1.5rem;
    transition: all 0.2s ease;
    z-index: 2001;
}

.event-details-modal .close:hover {
    color: white;
    transform: scale(1.1);
}

/* Clickable Event Styles - Only for timed events */
.timed-event.clickable-event {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.timed-event.clickable-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.timed-event.clickable-event:active {
    transform: translateY(0);
}

/* Add a subtle indicator that timed events are clickable */
.timed-event.clickable-event::after {
    content: '👁';
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.timed-event.clickable-event:hover::after {
    opacity: 0.6;
}

/* All-day events should not appear clickable */
.all-day-event.clickable-event {
    cursor: default;
}

/* Silk Browser Specific Styles */
.silk-browser body {
    height: 980px !important;
}

.silk-browser .container {
    height: 980px !important;
}
