/* ============================================
   Add to GCal - Styles
   Glassmorphism design matching Squares app
   ============================================ */

:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-primary: rgba(0, 0, 0, 0.85);
    --text-secondary: rgba(0, 0, 0, 0.55);
    --accent: #007AFF;
    --accent-hover: #0056CC;
    --danger: #FF3B30;
    --success: #34C759;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Neue, Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(167, 139, 250, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(251, 146, 180, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(147, 197, 253, 0.4) 0%, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Container */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 24px;
    position: relative;
}

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

.logo {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.credit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.credit a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.credit a:hover {
    color: var(--accent);
}

/* About Button */
.about-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    z-index: 100;
}

.about-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.glass-card.success {
    animation: success-pulse 0.6s ease;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.05);
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    transform: translateY(-4px);
    color: var(--accent);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.drop-icon svg {
    width: 100%;
    height: 100%;
}

.drop-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* Upload Section */
.upload-section {
    display: block;
}

/* Camera Button (mobile only) */
.camera-btn {
    display: none;
    width: 100%;
    padding: 14px 20px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.camera-btn svg {
    width: 20px;
    height: 20px;
}

.camera-btn:hover {
    background: rgba(255, 255, 255, 0.55);
}

@media (pointer: coarse) {
    .camera-btn {
        display: inline-flex;
    }
}

/* Input Divider */
.input-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 16px;
}

.input-divider::before,
.input-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.input-divider span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Paste Section */
.paste-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.paste-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 90px;
    -webkit-appearance: none;
}

.paste-textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.paste-textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.paste-btn {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paste-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.paste-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress Section */
.progress-section {
    display: none;
    margin-top: 0;
    padding: 24px 0;
}

.progress-section.visible {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #5856D6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Review Section */
.review-section {
    display: none;
    margin-top: 0;
}

.review-section.visible {
    display: block;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.review-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-btn {
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* Screenshot Preview */
.screenshot-preview {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 160px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.screenshot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 160px;
    display: block;
}

/* Form Fields */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Side-by-side time fields */
.form-row {
    display: flex;
    gap: 16px;
}

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

/* Events List */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Event Card */
.event-card {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.event-card.added {
    opacity: 0.6;
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.event-card-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0, 122, 255, 0.1);
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-card-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    display: none;
}

.event-card.added .event-card-status {
    display: inline;
}

.event-card .add-single-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
    font-family: inherit;
}

.event-card .add-single-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.event-card.added .add-single-btn {
    background: var(--success);
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* Remove button for multi-event */
.event-card .remove-event-btn {
    font-size: 12px;
    font-weight: 500;
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.event-card .remove-event-btn:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* Action Section */
.action-section {
    display: none;
    margin-top: 24px;
}

.action-section.visible {
    display: block;
}

.process-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.35);
}

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

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.process-btn .btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.process-btn .btn-icon {
    width: 20px;
    height: 20px;
}

/* Success Section */
.success-section {
    display: none;
    text-align: center;
    padding: 24px 0;
}

.success-section.visible {
    display: block;
}

.success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    color: var(--success);
}

.success-icon svg {
    width: 100%;
    height: 100%;
}

.success-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.secondary-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(0, 122, 255, 0.1);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.secondary-btn:hover {
    background: rgba(0, 122, 255, 0.18);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.modal-content p:last-of-type {
    margin-bottom: 0;
}

.modal-credit {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-version {
    font-size: 13px !important;
    color: rgba(0, 0, 0, 0.35) !important;
    margin-top: 8px;
}

.modal-content a {
    color: var(--accent);
    text-decoration: none;
}

.modal-content a:hover {
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

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

/* Animations */
@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 40px 16px;
    }

    .glass-card {
        padding: 24px;
    }

    .logo {
        font-size: 32px;
    }

    .drop-zone {
        padding: 28px 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .process-btn {
        padding: 14px 20px;
    }

    .about-btn {
        top: 12px;
        left: 12px;
    }
}
