/* Gmail Automation Platform - Main Stylesheet */

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4285f4;
    --primary-dark: #357ae8;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc05;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-light: #80868b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --border-color: #dadce0;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-md: 0 1px 2px 0 rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
    --shadow-lg: 0 2px 4px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 1rem;
}

/* ============================================================================
   HERO SECTION (LANDING PAGE)
   ============================================================================ */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-item {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hero-info {
    display: flex;
    gap: 2rem;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.hero-info p {
    margin: 0;
}

/* ============================================================================
   FEATURES SECTION
   ============================================================================ */
.features {
    padding: 4rem 0;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.feature-step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.feature-step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-step p {
    color: var(--text-secondary);
}

/* ============================================================================
   AUTHENTICATION PAGES
   ============================================================================ */
.auth-page {
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 0 20px;
}

.auth-box {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-google-section {
    margin-bottom: 1.5rem;
}

.auth-divider-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 1rem;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    cursor: pointer;
}

.radio-content {
    flex: 1;
}

.radio-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.radio-content small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.radio-group {
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: rgba(66, 133, 244, 0.1);
}

.btn-google {
    width: 100%;
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem;
}

.btn-google:hover {
    box-shadow: var(--shadow-sm);
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================================================
   ALERTS
   ============================================================================ */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #64b5f6;
}

/* ============================================================================
   DASHBOARD
   ============================================================================ */
.dashboard-container {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.dashboard-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.dashboard-header .header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar,
.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
}

.dashboard-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.dashboard-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* ============================================================================
   SERVICES GRID
   ============================================================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.service-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.service-status.connected .status-indicator {
    background: var(--secondary-color);
}

.service-status.disconnected .status-indicator {
    background: var(--text-light);
}

.service-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.service-actions {
    margin-top: 1rem;
}

/* ============================================================================
   AUTOMATION CARD
   ============================================================================ */
.automation-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.automation-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.automation-meta {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================================
   TABLES
   ============================================================================ */
.summaries-table {
    overflow-x: auto;
}

.summaries-table table {
    width: 100%;
    border-collapse: collapse;
}

.summaries-table th,
.summaries-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.summaries-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.summaries-table tr:hover {
    background: var(--bg-secondary);
}

/* ============================================================================
   BADGES
   ============================================================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-instant {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-daily {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-weekly {
    background: #fff3e0;
    color: #e65100;
}

/* ============================================================================
   ACTIVITY LIST
   ============================================================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.activity-icon {
    color: var(--primary-color);
    font-size: 1.5rem;
    line-height: 1;
}

.activity-content {
    flex: 1;
}

.activity-content strong {
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-content p {
    margin: 0.25rem 0;
    color: var(--text-primary);
}

.activity-content small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.summary-text {
    white-space: pre-wrap;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.action-items {
    white-space: pre-wrap;
    line-height: 1.8;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
    }

    .dashboard-header .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .summaries-table {
        font-size: 0.9rem;
    }
}

