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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.google-signin-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.google-signin-button:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-badge {
    padding: 8px 16px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border: 1px solid #667eea;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background: #667eea;
    color: white;
}

h1 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

.upload-section {
    margin-bottom: 30px;
}

.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9ff;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.drag-over {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.02);
}

.drop-zone-content {
    width: 100%;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.drop-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.or-text {
    color: #999;
    margin: 15px 0;
}

.upload-button {
    display: inline-block;
    padding: 15px 40px;
    background: #667eea;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.upload-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.file-types {
    margin-top: 15px;
    color: #999;
    font-size: 0.9rem;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.remove-button {
    padding: 10px 25px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.remove-button:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.process-button {
    width: 100%;
    padding: 18px;
    background: #764ba2;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.process-button:hover:not(:disabled) {
    background: #663399;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

.process-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: #666;
    font-size: 1.1rem;
}

.results {
    margin-top: 30px;
}

.results h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.extracted-text {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

.shifts-list {
    margin-bottom: 20px;
}

.event-title-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.event-title-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.event-title-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.event-title-input:focus {
    outline: none;
    border-color: #667eea;
}

.event-title-hint {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #666;
}

.calendar-mode {
    margin-top: 30px;
}

.calendar-mode h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.calendar-mode h3 {
    color: #333;
    font-size: 1.3rem;
    margin: 25px 0 15px;
}

.calendar-info {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    font-weight: 500;
}

.dates-preview {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.dates-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.date-badge {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    font-size: 1rem;
}

.time-input-section {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.time-input-group {
    flex: 1;
}

.time-input-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.time-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.time-input:focus {
    outline: none;
    border-color: #667eea;
}

.time-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #888;
}

.shift-item {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.shift-date {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.shift-time {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.shift-original {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.download-button, .sync-button {
    flex: 1;
    min-width: 200px;
    padding: 18px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.download-button {
    background: #28a745;
}

.download-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.sync-button {
    background: #667eea;
}

.sync-button:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.sync-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.sync-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
}

.sync-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sync-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error {
    text-align: center;
    padding: 30px;
    background: #fee;
    border-radius: 10px;
    margin-top: 20px;
}

.error p {
    color: #c33;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.retry-button {
    padding: 15px 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

footer p {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .auth-section {
        margin-bottom: 15px;
    }

    .google-signin-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .user-status {
        flex-direction: column;
        gap: 10px;
    }

    .drop-zone {
        padding: 30px 20px;
        min-height: 250px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .drop-text {
        font-size: 1rem;
    }

    .upload-button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .process-button,
    .download-button,
    .sync-button {
        padding: 15px;
        font-size: 1.1rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .download-button, .sync-button {
        width: 100%;
        min-width: auto;
    }

    .shift-item {
        padding: 15px;
    }

    .shift-time {
        font-size: 1.1rem;
    }
}

/* Refined app shell and review experience */
:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --ink: #172033;
    --muted: #667085;
    --line: #e5e7eb;
    --surface: #ffffff;
    --soft-blue: #eff6ff;
}

body {
    background: #f6f8fb;
    color: var(--ink);
    padding: 28px 16px;
}

.container {
    max-width: 680px;
    padding: 34px 40px 40px;
    border: 1px solid #e7eaf0;
    border-radius: 24px;
    box-shadow: 0 16px 45px rgba(31, 42, 68, .08);
}

header {
    margin-bottom: 32px;
}

.app-name {
    margin-bottom: 26px;
    color: var(--brand, #2563eb);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: center;
}

.auth-section {
    justify-content: flex-start;
    margin-bottom: 34px;
}

.auth-section:not(:has(.user-status)) {
    justify-content: center;
}

.user-status {
    width: 100%;
    justify-content: space-between;
}

.status-badge {
    padding: 7px 12px;
    background: #ecfdf3;
    color: #16704a;
    border: 1px solid #c9f2db;
    border-radius: 999px;
    font-size: .82rem;
}

.logout-link {
    color: var(--muted);
    border: 0;
    padding: 5px 0;
    font-size: .82rem;
}

.logout-link:hover {
    background: transparent;
    color: var(--brand);
}

.google-signin-button {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: .9rem;
    box-shadow: 0 2px 5px rgba(16, 24, 40, .05);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    color: var(--brand);
    background: var(--soft-blue);
    border-radius: 13px;
}

.brand-mark svg {
    width: 25px;
    height: 25px;
}

h1 {
    max-width: 520px;
    margin: 0 auto 12px;
    color: var(--ink);
    font-size: clamp(1.85rem, 5vw, 2.55rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}

.drop-zone {
    min-height: 280px;
    padding: 38px 24px;
    border: 1.5px dashed #b9c7df;
    border-radius: 18px;
    background: #fbfcfe;
}

.drop-zone.drag-over {
    border-color: var(--brand);
    background: var(--soft-blue);
    transform: none;
}

.drop-zone.has-preview {
    min-height: 0;
    border-style: solid;
    border-color: var(--line);
    background: var(--surface);
}

.upload-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    color: var(--brand);
}

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

.drop-text {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 600;
}

.or-text {
    margin: 12px 0;
    color: #98a2b3;
    font-size: .88rem;
}

.upload-button {
    padding: 12px 22px;
    background: var(--brand);
    border-radius: 10px;
    font-size: .95rem;
}

.upload-button:hover,
.process-button:hover:not(:disabled),
.sync-button:hover:not(:disabled) {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, .2);
}

.file-types {
    margin-top: 13px;
    font-size: .8rem;
}

.preview-container img {
    max-height: 360px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(16, 24, 40, .12);
}

.remove-button {
    padding: 8px 14px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .85rem;
}

.remove-button:hover {
    background: #fff5f5;
    color: #c0392b;
    transform: none;
}

.process-button {
    margin-top: 14px;
    padding: 14px;
    background: var(--brand);
    border-radius: 10px;
    font-size: 1rem;
}

.results {
    margin-top: 34px;
}

.scan-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #16704a;
    font-size: .86rem;
    font-weight: 700;
}

.check-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: white;
    background: #19a974;
    border-radius: 50%;
    font-size: .75rem;
}

.results h2 {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 1.55rem;
    letter-spacing: -.02em;
}

.results-intro {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: .92rem;
}

.shifts-list {
    margin-bottom: 24px;
}

.shift-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 19px;
    margin-bottom: 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 13px;
    box-shadow: 0 3px 10px rgba(16, 24, 40, .04);
}

.shift-date {
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
}

.shift-time {
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 1.06rem;
    font-weight: 600;
}

.shift-time span {
    padding: 0 3px;
    color: #98a2b3;
}

.shift-duration {
    color: var(--muted);
    font-size: .84rem;
}

.shift-original {
    display: none;
}

.shift-controls {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.shift-controls button {
    padding: 5px 0;
    color: var(--brand);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
}

.shift-controls .delete-shift {
    color: #667085;
}

.shift-controls button:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.event-title-section {
    padding: 0;
    margin-bottom: 24px;
    background: transparent;
}

.event-title-label {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: .88rem;
}

.event-title-input {
    padding: 13px 14px;
    border: 1px solid #cfd5df;
    border-radius: 10px;
}

.event-title-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}

.sync-button,
.download-button {
    width: 100%;
    min-width: 0;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: .98rem;
}

.sync-button {
    order: 1;
    background: var(--brand);
}

.download-button {
    order: 2;
    color: var(--brand);
    background: transparent;
    border: 1px solid #b8c7e4;
}

.download-button:hover:not(:disabled) {
    color: var(--brand-dark);
    background: var(--soft-blue);
    transform: none;
    box-shadow: none;
}

.download-button:disabled,
.sync-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.sync-message {
    margin-top: 16px;
    font-size: .9rem;
}

.change-summary {
    margin: 0 0 22px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.change-group + .change-group {
    margin-top: 16px;
}

.change-group h3 {
    margin: 0 0 9px;
    color: var(--ink);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.change-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid #e8edf3;
}

.change-item:first-of-type {
    border-top: 0;
}

.change-side {
    flex: 1;
    min-width: 0;
}

.change-shift-date {
    color: var(--ink);
    font-size: .9rem;
    font-weight: 700;
}

.change-shift-time {
    margin-top: 3px;
    color: var(--muted);
    font-size: .84rem;
}

.change-shift-time span {
    padding: 0 2px;
    color: #98a2b3;
}

.change-shift-duration {
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.change-arrow {
    color: var(--brand);
    font-size: 1.15rem;
    font-weight: 700;
}

.removed-item {
    opacity: .72;
}

.no-changes {
    color: #16704a;
    font-size: .9rem;
    font-weight: 600;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .82rem;
}

.site-footer nav {
    display: flex;
    gap: 16px;
}

.site-footer a,
.legal-back,
.legal-content a {
    color: var(--brand);
    text-decoration: none;
}

.site-footer a:hover,
.legal-back:hover,
.legal-content a:hover {
    text-decoration: underline;
}

.legal-container {
    max-width: 760px;
}

.legal-header {
    text-align: left;
    margin-bottom: 30px;
}

.legal-header .app-name {
    margin-bottom: 18px;
    text-align: left;
}

.legal-header h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 5vw, 2.35rem);
}

.legal-updated {
    color: var(--muted);
    font-size: .9rem;
}

.legal-content {
    color: #344054;
    font-size: .98rem;
    line-height: 1.7;
}

.legal-content section + section {
    margin-top: 26px;
}

.legal-content h2 {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 1.15rem;
}

.legal-content p + p,
.legal-content ul {
    margin-top: 10px;
}

.legal-content ul {
    padding-left: 22px;
}

.legal-back {
    display: inline-block;
    margin-top: 32px;
    font-weight: 600;
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .container {
        min-height: 100vh;
        padding: 24px 18px 32px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-section {
        margin-bottom: 30px;
    }

    .drop-zone {
        min-height: 250px;
    }

    .shift-item {
        align-items: flex-start;
        padding: 16px;
    }

    .shift-controls {
        flex-direction: column;
        gap: 5px;
        align-items: flex-end;
    }

    .changed-item {
        align-items: flex-start;
        gap: 7px;
    }

    .site-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .legal-container {
        padding-bottom: 28px;
    }

    .change-shift-date {
        font-size: .82rem;
    }

    .change-shift-time {
        font-size: .75rem;
    }
}

/* Calendar Mode Mobile Responsiveness */
@media (max-width: 600px) {
    .time-input-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .dates-grid {
        gap: 8px;
    }
    
    .date-badge {
        padding: 6px 12px;
        min-width: 35px;
        font-size: 0.9rem;
    }
    
    .calendar-mode h2 {
        font-size: 1.5rem;
    }
    
    .calendar-mode h3 {
        font-size: 1.1rem;
    }
}
