/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Geist Mono', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    color: #000;
    background-color: #fff;
}

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

/* Header */
.header {
    background: #fff;
    border-bottom: 2px solid #000;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-emoji {
    font-size: 2rem;
    line-height: 1;
}

.logo-image {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #000;
    line-height: 1;
    font-family: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.logo-tagline {
    font-size: 0.625rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #000;
    border-radius: 0;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
    font-size: 0.875rem;
    font-family: 'Geist Mono', monospace;
    box-shadow: 4px 4px 0 0 #666;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 #666;
}

.btn-secondary {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}

.btn-secondary:hover {
    background: #000;
    color: #fff;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 #666;
}

.btn-success {
    background: #000;
    color: #fff;
}

.btn-success:hover {
    background: #fff;
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 #666;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Landing Page */
.landing-page {
    padding: 4rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    color: #000;
    margin-bottom: 1rem;
    line-height: 1.2;
    font-family: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    margin-bottom: 3rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    text-align: center;
    border: 2px solid #000;
    transition: background 0.15s, color 0.15s;
    box-shadow: 6px 6px 0 0 #666;
}

.feature:hover {
    background: #000;
    color: #fff;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #000;
}

.feature:hover h3 {
    color: #fff;
}

.feature p {
    color: #000;
}

.feature:hover p {
    color: #fff;
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: #000;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 0;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid #000;
    box-shadow: 8px 8px 0 0 #666;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 1rem;
}

/* Connection Status */
.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border-radius: 0;
    margin-bottom: 1rem;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 0 #666;
}

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

.connection-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.25rem;
}

.connection-info p {
    font-size: 0.875rem;
    color: #000;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 400;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 0 #666;
}

.status-connected {
    background: #000;
    color: #fff;
}

.status-disconnected {
    background: #fff;
    color: #000;
}

/* Email Display */
.email-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 0;
    border: 2px solid #000;
    margin: 1rem 0;
    box-shadow: 4px 4px 0 0 #666;
}

.email-display code {
    flex: 1;
    font-family: 'Geist Mono', monospace;
    font-size: 0.875rem;
    color: #000;
    background: transparent;
}

.help-text {
    font-size: 0.875rem;
    color: #000;
    background: #fff;
    padding: 1rem;
    border-radius: 0;
    border-left: 4px solid #000;
}

/* Processing History */
.history-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #000;
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    flex: 1;
}

.history-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.25rem;
}

.history-info p {
    font-size: 0.75rem;
    color: #000;
}

.history-status {
    margin-left: 1rem;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: 0;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 0 #666;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #000;
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 0.1em;
}

/* Footer */
.footer {
    background: #fff;
    border-top: 2px solid #000;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    font-size: 0.75rem;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #000;
    text-decoration: none;
    font-size: 0.75rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-overlay p {
    color: white;
    font-weight: 500;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    pointer-events: none;
}

.toast {
    background: #fff;
    border-radius: 0;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border: 2px solid #000;
    max-width: 400px;
    pointer-events: auto;
    position: relative;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 6px 6px 0 0 #666;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background: #000;
    color: #fff;
}

.toast.error {
    background: #fff;
    color: #000;
    border-color: #000;
}

.toast.warning {
    background: #fff;
    color: #000;
    border-color: #000;
}

.toast.info {
    background: #fff;
    color: #000;
    border-color: #000;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: none;
    flex-shrink: 0;
}

.toast.success .toast-close {
    color: #fff;
}

.toast-close:hover {
    background: transparent;
    color: inherit;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .email-display {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Google Sign-In Material Button */
.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: #000;
  background-image: none;
  border: 2px solid #000;
  -webkit-border-radius: 0;
  border-radius: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  font-size: 14px;
  height: 48px;
  letter-spacing: 0;
  outline: none;
  overflow: hidden;
  padding: 0 16px;
  position: relative;
  text-align: center;
  -webkit-transition: background-color .15s, color .15s, box-shadow .15s, transform .15s;
  transition: background-color .15s, color .15s, box-shadow .15s, transform .15s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
  box-shadow: 6px 6px 0 0 #666;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: 'Geist Mono', monospace;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity .218s;
  transition: opacity .218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:disabled {
  cursor: default;
  background-color: #ccc;
  border-color: #ccc;
  color: #666;
}

.gsi-material-button:disabled .gsi-material-button-state {
  background-color: transparent;
}

.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 1;
}

.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 0.5;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state, 
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: transparent;
  opacity: 1;
}

.gsi-material-button:not(:disabled):hover {
  background-color: #fff;
  color: #000;
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 0 #666;
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: transparent;
  opacity: 1;
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border: 2px solid transparent;
    border-bottom: none;
}

.tab-button:hover {
    background: #f5f5f5;
}

.tab-button.active {
    border: 2px solid #000;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    background: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Upload Styles */
.upload-card {
    margin-bottom: 2rem;
}

.upload-dropzone {
    border: 3px dashed #000;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #fafafa;
}

.upload-dropzone:hover:not(.disabled) {
    background: #f0f0f0;
    border-color: #333;
}

.upload-dropzone.dragover {
    background: #e8e8e8;
    border-color: #000;
    transform: scale(1.02);
}

.upload-dropzone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.dropzone-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dropzone-subtext {
    color: #666;
    margin-bottom: 1rem;
}

.dropzone-help {
    font-size: 0.875rem;
    color: #999;
    margin-top: 1rem;
}

.setup-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.setup-warning p {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* File List */
.file-list {
    margin-top: 2rem;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 1.5rem;
}

.file-list h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-icon {
    font-size: 2rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-size {
    font-size: 0.875rem;
    color: #666;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    color: #666;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.upload-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* Upload Progress */
.upload-progress {
    margin-top: 2rem;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 1.5rem;
}

.upload-progress h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.progress-item {
    margin-bottom: 1.5rem;
}

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

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-file {
    font-weight: 600;
    word-break: break-word;
}

.progress-status {
    color: #666;
    font-size: 0.875rem;
}

.progress-bar {
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #000;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s, background-color 0.3s;
}

/* Upload Results */
.upload-results {
    margin-top: 2rem;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 1.5rem;
}

.upload-results h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.results-summary {
    padding: 1rem;
    background: #f5f5f5;
    border: 2px solid #000;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.result-item {
    border: 2px solid #000;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.result-item.success {
    background: #f0fdf4;
    border-color: #10b981;
}

.result-item.error {
    background: #fef2f2;
    border-color: #ef4444;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.result-icon {
    font-size: 1.5rem;
}

.result-file {
    font-weight: 600;
    word-break: break-word;
}

.result-details {
    padding-left: 2.25rem;
}

.result-details p {
    margin-bottom: 0.5rem;
}

.result-details p:last-child {
    margin-bottom: 0;
}

.result-details a {
    color: #3b82f6;
    text-decoration: underline;
}

.result-details a:hover {
    color: #2563eb;
}

.error-message {
    color: #ef4444;
    font-weight: 600;
}

/* Coming Soon Badge */
.badge-coming-soon {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* Debug Section */
.debug-section {
    margin-top: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0.5rem;
    background: #f9fafb;
}

.debug-section summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.5rem;
    user-select: none;
}

.debug-section summary:hover {
    background: #f3f4f6;
    border-radius: 4px;
}

.debug-content {
    padding: 1rem;
    margin-top: 0.5rem;
}

.debug-item {
    margin-bottom: 1rem;
}

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

.debug-item h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.debug-item pre {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .tabs {
        overflow-x: auto;
    }
    
    .tab-button {
        white-space: nowrap;
    }
    
    .upload-dropzone {
        padding: 2rem 1rem;
    }
    
    .dropzone-icon {
        font-size: 3rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .upload-actions {
        flex-direction: column;
    }
    
    .upload-actions .btn {
        width: 100%;
    }
}
