:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --secondary: #10B981;
    --dark: #111827;
    --gray-dark: #374151;
    --gray: #6B7280;
    --gray-light: #F3F4F6;
    --white: #FFFFFF;
    --error: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-light);
    color: var(--dark);
    line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 30px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--gray-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    animation: fadeIn 0.8s ease-out;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 1s ease-out 0.2s both;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeIn 1.2s ease-out 0.4s both;
}

.btn-hero {
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-hero-primary {
    background: white;
    color: var(--primary);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-hero-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-hero-secondary:hover {
    background: white;
    color: var(--primary);
}

/* Auth Forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.6s ease-out;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo a {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.auth-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control.error {
    border-color: var(--error);
}

.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.btn-auth:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.divider {
    text-align: center;
    margin: 20px 0;
    color: var(--gray);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--error);
}

.toast.warning i {
    color: var(--warning);
}

/* Profile Page */
.dashboard-container {
    min-height: 100vh;
    background: var(--gray-light);
}

.dashboard-header {
    background: white;
    padding: 40px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.welcome-text h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.welcome-text p {
    color: var(--gray);
    font-size: 18px;
}

.dashboard-stats {
    display: flex;
    gap: 30px;
}

.stat-box {
    text-align: center;
}

.stat-box .number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .label {
    color: var(--gray);
    font-size: 14px;
}

.dashboard-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.6s ease-out;
}

.card h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--dark);
}

.card.full-width {
    grid-column: span 2;
}

/* Form Builder Prompt */
.prompt-card {
    background: var(--gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

.prompt-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.prompt-input-group {
    position: relative;
    z-index: 1;
}

.prompt-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s;
}

.prompt-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.prompt-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.prompt-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: var(--primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.prompt-submit:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .card.full-width {
        grid-column: span 1;
    }

    .dashboard-stats {
        flex-direction: column;
        gap: 20px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--gray-dark);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--gray);
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}



/* Apps Page */
.apps-container {
    min-height: 100vh;
    background: var(--gray-light);
}

.apps-header {
    background: white;
    padding: 40px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.apps-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.apps-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.apps-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.app-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.app-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.app-info h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.app-info p {
    color: var(--gray);
    font-size: 14px;
}

.app-status {
    border-top: 1px solid var(--gray-light);
    padding-top: 20px;
}

.connections-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-light);
    border-radius: 8px;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.connection-name {
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    text-transform: capitalize;
}

.connection-status i {
    font-size: 8px;
}

.status-active {
    color: var(--success);
}

.status-inactive {
    color: var(--gray);
}

.status-error {
    color: var(--error);
}

.status-expired {
    color: var(--warning);
}

.connection-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: white;
    border: 1px solid var(--gray-light);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-add-connection {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px dashed var(--gray-light);
    border-radius: 8px;
    color: var(--gray);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-connection:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.no-connection {
    text-align: center;
}

.no-connection p {
    color: var(--gray);
    margin-bottom: 15px;
}

.btn-connect {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-connect:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
}

.modal-body {
    padding: 25px;
}



/* OAuth Buttons */
.oauth-info {
    text-align: center;
    margin-bottom: 30px;
}

.oauth-info ul {
    max-width: 300px;
    margin: 20px auto;
}

.oauth-info li {
    margin-bottom: 8px;
    color: var(--gray-dark);
}

.btn-oauth {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-oauth.google {
    background: #4285F4;
    color: white;
}

.btn-oauth.google:hover {
    background: #357ae8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3);
}

.btn-oauth.slack {
    background: #4A154B;
    color: white;
}

.btn-oauth.slack:hover {
    background: #3a103b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 21, 75, 0.3);
}

.connection-form {
    padding: 20px;
}

.connection-form .form-group {
    margin-bottom: 20px;
}


/* Connection Details */
.connection-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.connection-email {
    font-size: 12px;
    color: var(--gray);
}

/* View Spreadsheets Button */
.btn-icon.view-spreadsheets {
    background: #0F9D58;
    color: white;
    border-color: #0F9D58;
}

.btn-icon.view-spreadsheets:hover {
    background: #0C7D48;
}

/* Spreadsheets List */
.spreadsheets-list {
    max-height: 400px;
    overflow-y: auto;
}

.spreadsheet-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.spreadsheet-item:hover {
    background: var(--gray-light);
    border-color: var(--primary);
}

.spreadsheet-icon {
    width: 40px;
    height: 40px;
    background: #0F9D5820;
    color: #0F9D58;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.spreadsheet-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.spreadsheet-info p {
    margin: 0;
    font-size: 12px;
    color: var(--gray);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* Connection Info Improvements */
.connection-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--gray-light);
    border-radius: 8px;
    margin-bottom: 10px;
}

.connection-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Status improvements */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--gray-light);
}

.status-active {
    color: var(--success);
    background: #10B98115;
}

.status-error {
    color: var(--error);
    background: #EF444415;
}

.status-inactive {
    color: var(--gray);
    background: var(--gray-light);
}




/* Database Forms */
.form-row {
    display: flex;
    gap: 15px;
}

.db-info {
    text-align: center;
    margin-bottom: 30px;
}

/* Tables List */
.tables-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.table-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.table-item:hover {
    background: var(--gray-light);
    border-color: var(--primary);
}

.table-icon {
    width: 40px;
    height: 40px;
    background: #00758F20;
    color: #00758F;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.table-info {
    flex: 1;
}

.table-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.table-info p {
    margin: 0;
    font-size: 12px;
    color: var(--gray);
}

.table-arrow {
    color: var(--gray);
}

/* Table Structure */
.table-structure {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table-structure th {
    background: var(--gray-light);
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.table-structure td {
    padding: 10px;
    border-bottom: 1px solid var(--gray-light);
}

.table-structure tr:hover {
    background: var(--gray-light);
}

/* View Tables Button */
.btn-icon.view-tables {
    background: #00758F;
    color: white;
    border-color: #00758F;
}

.btn-icon.view-tables:hover {
    background: #005a6a;
}



/* Tool Configuration */
.tool-config-form {
    padding: 20px;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

/* Test Result */
.test-result {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
}

.test-result pre {
    background: white;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 14px;
}

/* Tool Cards */
.app-card.tool-card {
    border: 2px dashed var(--gray-light);
}

.app-card.tool-card:hover {
    border-color: var(--primary);
}