:root {
    --bg-base: #09090b; 
    --bg-elevated: #18181b; /* Modal bg */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa; 
    --text-muted: #71717a; 
    
    --accent: #ffffff;
    --accent-text: #09090b;
    --accent-hover: #e4e4e7;
    
    --success: #10b981;
    
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Better for mobile */
    padding: 16px;
    overflow-x: hidden;
    position: relative;
    color-scheme: dark;
}

.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, rgba(9, 9, 11, 0) 60%);
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 460px;
    background: var(--bg-base); /* removed blur for pure flat minimal look */
    border-radius: 20px;
    position: relative;
    z-index: 1;
    padding: 0 0 40px;
    margin-top: 24px;
}

/* Header & Title */
.header-row {
    padding: 32px 16px 16px 16px;
    margin-bottom: 24px;
}

.title-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
}
.title-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Sections & Rows */
.form-section {
    margin-bottom: 32px;
}

.gcal-row {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 16px;
    gap: 16px;
}

.gcal-row.align-top {
    align-items: flex-start;
}

.icon-col {
    width: 24px;
    display: flex;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.mt-2 { margin-top: 8px; }

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

.toggle-col {
    justify-content: space-between;
    align-items: center;
}

.datetime-col {
    justify-content: space-between;
    align-items: center;
}

/* Form Controls */
.transparent-input,
.transparent-select,
.transparent-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
}

.transparent-input::placeholder,
.transparent-textarea::placeholder {
    color: var(--text-secondary);
}

.transparent-select {
    appearance: none;
    -webkit-appearance: none;
}

.transparent-select option {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.transparent-textarea {
    resize: none;
    padding-top: 8px;
    line-height: 1.5;
}

input[type="date"], input[type="time"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 0;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    display: none; /* Hide default icons for cleaner look */
    -webkit-appearance: none;
}

/* Toggle Switch */
.toggle-label {
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--glass-border);
    transition: var(--transition-smooth);
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: var(--transition-smooth);
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before {
    background-color: var(--accent-text);
    transform: translateX(20px);
}

/* Buttons */
button {
    width: calc(100% - 32px);
    margin: 24px 16px;
    padding: 16px;
    border-radius: 100px;
    border: none;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
button:active { transform: translateY(0); }

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

.icon-btn {
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
}
.icon-btn:hover { background: var(--glass-border); }

/* Spinners & Utilities */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(9, 9, 11, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-text);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }

/* Modal Overlay (Location Picker) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* Translucent dark backdrop */
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Slides from bottom on mobile */
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content {
    background: var(--bg-base);
    width: 100%;
    max-width: 480px;
    height: 90vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}
.search-wrap input::placeholder { color: var(--text-secondary); }

.clear-btn {
    position: absolute;
    right: 0;
    width: 32px;
    height: 32px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
}

/* Location Results */
.location-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}
.location-item:active { background: var(--glass-border); }

.loc-icon {
    width: 24px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.loc-details { flex: 1; min-width: 0; }
.loc-name { font-size: 16px; color: var(--text-primary); font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-address { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60%;
    color: var(--text-muted);
    gap: 12px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-overlay.closing { animation: fadeOut 0.3s forwards; }
.modal-overlay.closing .modal-content { animation: slideDown 0.3s forwards; }

/* Result container */
#result-container {
    text-align: center;
    padding: 40px 24px;
    animation: fadeIn 0.4s ease;
}
.success-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    color: var(--success);
    margin-bottom: 16px;
}
.result-box h2 { font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.result-box .hint { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.link-wrapper {
    display: flex;
    background: var(--glass-border);
    border-radius: 12px;
    padding: 4px 4px 4px 16px;
    align-items: center;
    margin-bottom: 24px;
}
.link-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    font-family: monospace;
    font-size: 14px;
}

.time-wrap {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 150px;
    opacity: 1;
}

.time-wrap.collapsed {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    padding: 0;
    pointer-events: none;
}

/* Toast container */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

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

@media (min-width: 500px) {
    .container { 
        margin-top: 64px; 
        border: 1px solid var(--glass-border);
        box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.8);
    }
    
    .modal-overlay {
        align-items: center; /* Center horizontally/vertically on desktop */
    }
    
    .modal-content {
        height: 600px;
        max-height: 85vh;
        border-radius: 20px;
        border: 1px solid var(--glass-border);
    }
}
