/* MeetSync - Availability Scheduler Styles */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #6b7280;
    --success: #10b981;
    --available: #22c55e;
    --available-light: #bbf7d0;
    --unavailable: #ef4444;
    --unavailable-light: #fecaca;
    --background: #f9fafb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 8px 16px;
}

.btn-text:hover {
    background: rgba(79, 70, 229, 0.1);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Start Section */
.start-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.start-options .btn-primary {
    width: 100%;
    max-width: 300px;
    padding: 16px 32px;
    font-size: 1.1rem;
}

.divider {
    color: var(--text-light);
    position: relative;
    width: 100%;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.join-group {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.join-group input {
    flex: 1;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

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

input[type="text"],
input[type="date"],
input[type="time"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.date-range,
.time-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range input,
.time-range input {
    flex: 1;
}

.date-range span,
.time-range span {
    color: var(--text-light);
}

.time-options {
    margin-bottom: 12px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.checkbox-label input,
.radio-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

/* Event Header */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.event-code {
    background: var(--background);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.95rem;
}

/* Participant Input */
.participant-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.participant-input label {
    font-weight: 500;
    margin-bottom: 8px;
}

.participant-input input {
    flex: 1;
    max-width: 300px;
}

.name-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--available-light);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.name-badge strong {
    color: var(--success);
}

/* Mode Indicator */
.mode-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

#mode-text {
    font-weight: 500;
}

.legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.available {
    background: var(--available);
}

.legend-color.unavailable {
    background: var(--unavailable);
}

/* Calendar Grid */
.calendar-container {
    overflow-x: auto;
    margin: 0 -10px;
    padding: 0 10px;
}

.calendar-grid {
    display: grid;
    gap: 2px;
    min-width: fit-content;
}

.calendar-header {
    display: contents;
}

.calendar-header .day-header {
    text-align: center;
    padding: 12px 8px;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--background);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-width: 80px;
}

.day-header .date {
    display: block;
    font-size: 1.1rem;
    margin-top: 4px;
}

.day-header .weekday {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.time-label {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.time-slot {
    padding: 12px;
    background: var(--background);
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 44px;
    position: relative;
}

.time-slot:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.time-slot.available {
    background: var(--available);
    color: white;
}

.time-slot.unavailable {
    background: var(--unavailable);
    color: white;
}

.time-slot.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-slot.disabled:hover {
    border-color: transparent;
    transform: none;
}

/* Results Mode */
.results-mode .time-slot {
    cursor: default;
}

.results-mode .time-slot:hover {
    border-color: transparent;
    transform: none;
}

.time-slot .slot-count {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

/* Heat map colors for results */
.time-slot.heat-0 { background: #f3f4f6; }
.time-slot.heat-1 { background: #dcfce7; }
.time-slot.heat-2 { background: #bbf7d0; }
.time-slot.heat-3 { background: #86efac; }
.time-slot.heat-4 { background: #4ade80; }
.time-slot.heat-5 { background: #22c55e; color: white; }

/* Results Legend */
.results-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.heat-scale {
    display: flex;
    align-items: center;
    gap: 8px;
}

.heat-gradient {
    width: 120px;
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(to right, #f3f4f6, #dcfce7, #86efac, #22c55e);
}

.heat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Best Times */
.best-times {
    margin-top: 24px;
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.best-times h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.best-times ul {
    list-style: none;
}

.best-times li {
    padding: 10px 16px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.best-times li:last-child {
    margin-bottom: 0;
}

.best-times .count-badge {
    background: var(--available);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Actions */
.picker-actions,
.results-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .event-header {
        flex-direction: column;
    }

    .participant-input {
        flex-direction: column;
        align-items: stretch;
    }

    .participant-input input {
        max-width: none;
    }

    .mode-indicator {
        flex-direction: column;
        align-items: flex-start;
    }

    .picker-actions,
    .results-actions {
        flex-direction: column;
        gap: 12px;
    }

    .picker-actions .btn,
    .results-actions .btn {
        width: 100%;
    }

    .join-group {
        flex-direction: column;
    }

    .date-range,
    .time-range {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* Date-only mode (no time slots) */
.calendar-grid.date-only .time-slot {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Drag selection */
.time-slot.selecting {
    opacity: 0.7;
}

/* ==================== Authentication Styles ==================== */

.auth-status {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 24px;
    text-align: center;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: var(--background);
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-tab:hover:not(.active) {
    background: var(--border);
}

.btn-full {
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-light);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 16px;
}

.btn-oauth {
    width: 100%;
    padding: 14px 24px;
    background: white;
    border: 2px solid var(--border);
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-oauth:hover {
    background: var(--background);
    border-color: var(--text-light);
}

.btn-oauth svg {
    flex-shrink: 0;
}

/* Recent Events */
.recent-events {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.recent-events h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.recent-events ul {
    list-style: none;
}

.recent-event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-event-item:hover {
    background: var(--border);
}

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

.event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-code-small {
    font-size: 0.8rem;
    color: var(--text-light);
    font-family: monospace;
}

.event-arrow {
    color: var(--text-light);
    font-size: 1.2rem;
}

.delete-event-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.delete-event-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Guest Section */
.guest-event-info {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.guest-event-info h3 {
    color: var(--primary);
    margin: 0;
}

.guest-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    color: #92400e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.guest-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
}

/* Payment Section */
.payment-header {
    text-align: center;
    margin-bottom: 24px;
}

.payment-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.pricing-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: var(--radius);
    padding: 32px 24px;
    color: white;
    text-align: center;
    margin-bottom: 24px;
}

.price-tag {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 24px;
}

.price-tag .currency {
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.9;
}

.price-tag .amount {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.price-tag .period {
    font-size: 1rem;
    opacity: 0.8;
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.features-list li {
    padding: 8px 0;
    font-size: 0.95rem;
    opacity: 0.95;
}

.pricing-card .btn {
    background: white;
    color: var(--primary);
    font-weight: 600;
}

.pricing-card .btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.payment-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* Pro Badge */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
