/* ==========================================
   Google Calendar App - Styles
   ========================================== */

:root {
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --danger: #d93025;
    --danger-hover: #b3261e;
    --bg: #f8f9fa;
    --white: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.16);
    --radius: 8px;
}

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

body {
    font-family: 'Google Sans', 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ==========================================
   Login Page
   ========================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 48px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--text);
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.btn-google:hover {
    box-shadow: var(--shadow-lg);
    background: #f6f8fc;
}

/* ==========================================
   App Header
   ========================================== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--bg);
    color: var(--danger);
    border-color: var(--danger);
}

/* ==========================================
   Calendar Container
   ========================================== */

.calendar-container {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

#calendar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.fc .fc-toolbar-title {
    font-size: 18px !important;
    font-weight: 500 !important;
}

.fc .fc-button {
    border-radius: var(--radius) !important;
    font-size: 13px !important;
    padding: 6px 12px !important;
}

.fc .fc-button-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.fc .fc-button-primary:hover {
    background-color: var(--primary-hover) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--primary-hover) !important;
}

.fc .fc-event {
    border-radius: 4px !important;
    padding: 2px 4px !important;
    cursor: pointer;
}

.fc .fc-daygrid-day:hover {
    background: #f0f4ff;
}

.fc .fc-highlight {
    background: rgba(26, 115, 232, 0.1) !important;
}

/* ==========================================
   Modal
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

#eventForm {
    padding: 24px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.form-actions-right {
    display: flex;
    gap: 8px;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

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

/* ==========================================
   Loading Overlay
   ========================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .calendar-container {
        padding: 12px;
    }

    .app-header {
        padding: 10px 16px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
    }
}
