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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Navigation */
.navbar {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.logo:hover {
    color: #2980b9;
}

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

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    color: #3498db;
}

.user-email {
    color: #ecf0f1;
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: transparent;
    color: #ecf0f1;
    border: 1px solid #ecf0f1;
}

.btn-secondary:hover {
    background-color: #ecf0f1;
    color: #2c3e50;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

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

.feature-card {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #3498db;
}

.feature-card p {
    color: #666;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-group .errorlist {
    list-style: none;
    margin-top: 0.5rem;
}

.form-group .errorlist li {
    color: #e74c3c;
    font-size: 0.9rem;
}

.helptext {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #777;
}

.form-actions {
    margin-top: 2rem;
}

.form-actions button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.form-footer a {
    color: #3498db;
    text-decoration: none;
}

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

/* Messages */
.messages-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 20px;
}

.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border-left: 4px solid;
}

.message-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.message-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.message-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.message-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .features h2 {
        font-size: 2rem;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
    }
}

/* Dashboard Styles */
.dashboard-container {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

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

.dashboard-header h1 {
    color: #2c3e50;
    font-size: 2rem;
}

/* CTA Card */
.cta-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 800px;
    margin: 0 auto;
}

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

.cta-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-card p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Dashboard Content */
.dashboard-content {
    max-width: 1000px;
}

.config-status {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-header h2 {
    color: #2c3e50;
    margin: 0;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

.status-value {
    color: #333;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

/* Features Overview */
.features-overview {
    margin-top: 2rem;
}

.features-overview h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.feature-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-box {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.feature-box h3 {
    color: #3498db;
    margin-bottom: 1rem;
}

.feature-box p {
    color: #666;
    margin-bottom: 1rem;
}

.feature-box ul {
    margin-left: 1.5rem;
    color: #666;
}

.feature-box ul li {
    margin-bottom: 0.5rem;
}

.webhook-url {
    margin-top: 1rem;
}

.webhook-url label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.webhook-url code {
    display: block;
    background-color: #f4f4f4;
    padding: 0.75rem;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

/* Config Instructions */
.config-instructions {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.config-instructions h3 {
    color: #1976d2;
    margin-bottom: 1rem;
}

.config-instructions ol {
    margin-left: 1.5rem;
    color: #333;
}

.config-instructions ol li {
    margin-bottom: 0.5rem;
}

.config-instructions code {
    background-color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Danger Zone */
.danger-zone {
    margin-top: 3rem;
    padding: 2rem;
    background-color: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 8px;
}

.danger-zone h3 {
    color: #c53030;
    margin-bottom: 0.5rem;
}

.danger-zone p {
    color: #742a2a;
    margin-bottom: 1rem;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-danger:hover {
    background-color: #c53030;
}

.form-actions .btn {
    margin-right: 1rem;
}

/* Company Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.company-context {
    color: #666;
    margin-top: 0.5rem;
}

.companies-switcher {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.companies-switcher h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.company-pills {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.company-pill {
    padding: 0.5rem 1.25rem;
    background-color: #f4f4f4;
    border: 2px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
    font-weight: 500;
}

.company-pill:hover {
    background-color: #e8e8e8;
    border-color: #3498db;
}

.company-pill.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.company-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.company-content {
    max-width: 1000px;
}

.members-section,
.invitations-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.members-section h2,
.invitations-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.members-list,
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.member-card,
.invitation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.member-info,
.invitation-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.member-email,
.invitation-date {
    font-size: 0.9rem;
    color: #666;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-owner {
    background-color: #ffd700;
    color: #856404;
}

.role-admin {
    background-color: #d1ecf1;
    color: #0c5460;
}

.role-member {
    background-color: #d4edda;
    color: #155724;
}

.empty-state {
    color: #999;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.invitation-details {
    text-align: center;
}

.invitation-info-box {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.invitation-info-box h2 {
    color: #3498db;
    margin: 1rem 0;
}

.invitation-meta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .cta-card {
        padding: 2rem 1rem;
    }
    
    .cta-icon {
        font-size: 3rem;
    }
    
    .cta-card h2 {
        font-size: 1.5rem;
    }
    
    .status-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .feature-boxes {
        grid-template-columns: 1fr;
    }
    
    .company-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .member-card,
    .invitation-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Setup Suggestions */
.setup-suggestions {
    margin: 2rem 0;
}

.setup-suggestions h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.suggestion-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.suggestion-header h3 {
    color: #2c3e50;
    margin: 0;
}

.license-badge {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.suggestion-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.license-info-banner {
    background-color: #f0f7ff;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin: 1rem 0 1.5rem 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.license-info-banner strong {
    color: #1976d2;
}

.feature-available {
    padding: 0.25rem 0.75rem;
    background-color: #d4edda;
    color: #155724;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.feature-unavailable {
    padding: 0.25rem 0.75rem;
    background-color: #fff3cd;
    color: #856404;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.setup-steps,
.setup-benefits {
    margin: 1.5rem 0;
}

.setup-steps h4,
.setup-benefits h4 {
    color: #3498db;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.setup-steps ol {
    margin-left: 1.5rem;
    color: #333;
}

.setup-steps ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.setup-benefits ul {
    margin-left: 1.5rem;
    color: #333;
}

.setup-benefits ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.setup-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

.suggestion-action {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e8e8e8;
    text-align: center;
}

.suggestion-action .btn {
    font-size: 1.1rem;
    padding: 0.75rem 2.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.suggestion-action .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.action-hint {
    margin-top: 0.75rem;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Agent Tasks Section */
.agent-tasks-section {
    margin-top: 2rem;
}

.agent-tasks-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.agent-tasks-table-wrapper {
    overflow-x: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-tasks-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.agent-tasks-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0.75rem;
    white-space: nowrap;
}

.agent-tasks-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.agent-task-row.status-completed td {
    border-left: 4px solid #28a745;
}

.agent-task-row.status-failed td {
    border-left: 4px solid #dc3545;
}

.agent-task-row.status-pending td {
    border-left: 4px solid #ffc107;
}

/* Ensure left-border is only on the first cell */
.agent-task-row td:not(:first-child) {
    border-left: none;
}

.task-row-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.task-row-link:focus-visible {
    outline: 3px solid #4d90fe;
    outline-offset: 2px;
}

.col-id {
    width: 1%;
    white-space: nowrap;
    font-weight: 600;
}

.col-status {
    width: 1%;
    white-space: nowrap;
}

.col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.task-type {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.task-subtext {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.task-action-form {
    display: inline;
    margin: 0;
}

.task-actions-empty {
    color: #94a3b8;
}

.status-badge.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Make the table layout denser on small screens */
@media (max-width: 768px) {
    .agent-tasks-table {
        min-width: 420px;
    }

    .agent-tasks-table thead th,
    .agent-tasks-table tbody td {
        padding: 0.6rem;
    }

    .task-type {
        font-size: 0.95rem;
    }

    .task-subtext {
        font-size: 0.85rem;
    }
}

.task-id {
    color: #999;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Courier New', monospace;
}

.task-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-detail-item {
    color: #666;
    font-size: 0.95rem;
}

.task-detail-item strong {
    color: #555;
    margin-right: 0.5rem;
}

.task-result {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-message {
    color: #155724;
    background-color: #d4edda;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.task-error {
    margin-top: 0.75rem;
    color: #721c24;
    background-color: #f8d7da;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.task-error strong {
    color: #721c24;
}

/* Agent Task Detail */
.agent-task-detail-card {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.task-actions-card {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: white;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.task-actions-card form {
    margin: 0;
}

.task-actions-card .btn {
    padding: 0.75rem 1.5rem;
}

/* Agent Help Card */
.agent-help-card {
    background-color: white;
    padding: 3rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

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

.agent-help-card h3 {
    color: #2c3e50;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.agent-help-card > p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.help-step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.step-content h4 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

.step-content strong {
    color: #2c3e50;
}

.webhook-reminder {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: #f0f7ff;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    text-align: left;
}

.webhook-reminder h4 {
    color: #1976d2;
    margin-bottom: 0.75rem;
}

.webhook-reminder p {
    color: #555;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .help-step {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-number {
        align-self: flex-start;
    }
    
    .agent-help-card {
        padding: 2rem 1rem;
    }
    
    .help-icon {
        font-size: 3rem;
    }
}


