@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --primary-color: #000000;
    --secondary-color: #666666;
    --border-color: #eaeaea;
    --background-color: #fafafa;
    --error-color: #ef4444;
    --success-color: #10b981;
    --text-color: #171717;
    --modal-overlay: rgba(0, 0, 0, 0.4);
    --hover-bg: rgba(0, 0, 0, 0.03);
    --active-bg: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* File: public/css/header.css */

/* Basic header structure */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    position: relative;
}

/* Logo styles */
.navbar-brand {
    flex-shrink: 0;
}

.logo {
    height: 32px;
    width: auto;
    display: block;
}

/* Navigation menu */
.navbar-menu {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-link {
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background-color: #f3f4f6;
}

.nav-link.active {
    background-color: #f3f4f6;
    color: #111827;
}

/* Desktop user menu */
.desktop-user-menu {
    position: relative;
    margin-left: 1.5rem;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 0.375rem;
}

.user-menu-toggle:hover {
    background-color: #f3f4f6;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 0.5rem;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.user-dropdown a:hover {
    background-color: #f3f4f6;
}

/* Sign out link special styling */
.signout-link {
    color: #dc2626 !important;
}

.signout-link:hover {
    background-color: #fee2e2 !important;
}

/* Mobile specific styles */
.mobile-user-email {
    display: none;
}

.menu-toggle {
    display: none;
}

.mobile-only {
    display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
    .navbar {
        justify-content: space-between;
    }

    .mobile-user-email {
        display: block;
        font-size: 0.875rem;
        color: #374151;
        margin: 0 auto;
        padding: 0 1rem;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        max-width: 200px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        background: none;
        border: none;
        cursor: pointer;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 0.5rem;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .navbar-menu.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .mobile-only {
        display: block;
    }

    .desktop-user-menu,
    .desktop-only {
        display: none;
    }
}

/* Animation for dropdown menus */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown.active {
    animation: fadeIn 0.2s ease-out;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Form Builder Layout */
.form-builder {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Form Preview */
.form-preview {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
}

.form-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
}

.form-title-input {
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: transparent;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: 0.375rem;
    width: auto;
    color: var(--text-color);
}

.form-title-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.preview {
    min-height: 400px;
    padding: 1.5rem;
}

.preview-description {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
    margin-top: 1rem;
}

/* Form Controls */
.form-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.section-title svg {
    color: var(--secondary-color);
}

.field-types {
    display: grid;
    gap: 0.5rem;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.setting-label svg {
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: #fff;
    color: var(--text-color);
    transition: all 0.15s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn svg {
    color: var(--secondary-color);
    transition: color 0.15s ease;
}

.btn:hover {
    background-color: var(--hover-bg);
}

.btn:hover svg {
    color: var(--text-color);
}

.btn-primary {
    background-color: var(--text-color);
    border-color: var(--text-color);
    color: #fff;
}

.btn-primary svg {
    color: #fff;
}

.btn-primary:hover {
    background-color: #333;
    border-color: #333;
}

.btn-field {
    text-align: left;
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
}

/* Form Fields */
.field-wrapper {
    margin-bottom: 1rem;
    position: relative;
}

.form-content {
    color: var(--secondary-color);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    padding: 0.5rem;
}

.field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.field-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: #fff;
}

.field-input:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Settings */
.setting-group {
    margin-bottom: 1rem;
}

.required {
    color: var(--error-color);
    margin-left: 0.25rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: modalFade 0.2s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 500px;
    margin: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    animation: modalContentSlide 0.2s ease;
    overflow: hidden;
}

@keyframes modalContentSlide {
    from {
        transform: translateY(-8px);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.modal-close {
    padding: 0.5rem;
    margin: -0.5rem;
    border: none;
    background: transparent;
    color: var(--secondary-color);
    cursor: pointer;
    border-radius: 0.375rem;
    line-height: 0;
}

.modal-close:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
}

.checkbox-group {
    margin-top: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.setting-help {
    color: var(--secondary-color);
    font-size: 0.75rem;
    margin: -0.25rem 0 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-builder {
        grid-template-columns: 1fr;
    }

    .form-controls {
        order: -1;
    }
}

/* Form Preview Styles */
.preview .field-wrapper {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.preview .field-wrapper:hover {
    border-color: var(--text-color);
}

.preview .field-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.preview .btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Drag and Drop */
.dragging {
    opacity: 0.5;
}

.drag-over {
    border: 2px dashed var(--text-color);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.template-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.15s ease;
}

.template-card:hover {
    border-color: var(--text-color);
    transform: translateY(-2px);
}

.template-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.template-card p {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.template-card .btn {
    width: 100%;
}

@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.auth-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
}

.auth-box h1 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.auth-description, .auth-message {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.auth-message {
    text-align: left;
    margin: -0.5rem 0 1.5rem;
}

.auth-form .field-wrapper {
    margin-bottom: 1rem;
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
}

.forgot-password {
    color: var(--text-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    margin-bottom: 1rem;
}

.auth-alt {
    text-align: center;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

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

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

@media (max-width: 768px) {
    .auth-container {
        margin: 1rem auto;
    }

    .auth-box {
        padding: 1.5rem;
    }
}

/* Pricing Styles */
.pricing-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pricing-subtitle {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 3rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border: 2px solid var(--text-color);
    transform: scale(1.05);
}

.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pricing-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pricing-price {
    margin-bottom: 0.5rem;
}

.pricing-price .price {
    font-size: 2.5rem;
    font-weight: 600;
}

.pricing-price .period {
    color: var(--secondary-color);
}

.pricing-description {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.pricing-features {
    list-style: none;
    margin: 0;
    padding: 0;
    flex-grow: 1;
}

.pricing-features li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.875rem;
}

.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
}

.pricing-cta {
    margin-top: 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pricing-card.featured {
        transform: none;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

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

/* Form Description */
.form-preview-description {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-description-input {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--secondary-color);
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: transparent;
    resize: vertical;
}

.form-description-input:hover {
    border-color: var(--border-color);
}

.form-description-input:focus {
    outline: none;
    border-color: var(--text-color);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* 404 */
.error-container {
    text-align: center;
    padding: 4rem 1rem;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1;
}

.error-message {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.error-description {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-color);
}

/* Drag and Drop */
.field-wrapper {
    cursor: move;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.field-wrapper.dragging {
    opacity: 0.5;
    box-shadow: 0 0 0 2px var(--text-color);
}

.field-wrapper.drag-over-top {
    border-top: 2px solid var(--text-color);
}

.field-wrapper.drag-over-bottom {
    border-bottom: 2px solid var(--text-color);
}

.field-wrapper:hover {
    transform: translateX(4px);
}

/* Auth modal */
.modal-description {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.otp-input {
    letter-spacing: 0.25em;
    font-family: monospace;
    text-align: center;
    font-size: 1.25rem;
    padding: 0.5rem;
}

.auth-form .field-wrapper {
    margin-bottom: 1.5rem;
}

/* Additional modal improvements */
.modal-content {
    max-width: 400px;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

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

.btn-primary:hover {
    background-color: #333;
    border-color: #333;
}

.navbar-dropdown .navbar-item#signout-link {
    color: #dc2626;
}

.navbar-dropdown .navbar-item#signout-link:hover {
    background-color: #fee2e2;
}

/* Dashboard */
/* Dashboard Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.page-header .subtitle {
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.table-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.forms-table {
    width: 100%;
    border-collapse: collapse;
}

.forms-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--secondary-color);
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
}

.forms-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.forms-table tr:hover {
    background-color: var(--hover-bg);
}

.forms-table tr:last-child td {
    border-bottom: none;
}

.form-name {
    font-weight: 500;
    color: var(--text-color);
}

.form-id {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-badge.active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.new {
    background-color: #f3f4f6;
    color: #374151;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    .forms-table {
        min-width: 800px;
    }

    .action-buttons {
        flex-wrap: wrap;
    }
}

/* Manage form */
/* Manage Form Page Styles */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.stat-box .stat-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-box .stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
}

.chart-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    height: 300px;
}

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

.settings-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.settings-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.settings-form input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.settings-form input:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.submission-time {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.submission-field {
    margin-bottom: 0.25rem;
}

.submission-field span {
    font-weight: 500;
}

.view-all-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-wrap: wrap;
    }
}

/* Add to public/css/styles.css */

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.settings-form {
    position: relative;
}

.settings-form .alert {
    position: absolute;
    top: -3rem;
    left: 0;
    right: 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responses */
/* Add to public/css/styles.css */

/* Responses Page Styles */
.submissions-table-wrapper {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-top: 2rem;
}

.submissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.submissions-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    color: #374151;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.submissions-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #111827;
}

.submissions-table tr:last-child td {
    border-bottom: none;
}

.submissions-table tr:hover {
    background-color: #f9fafb;
}

.submission-date {
    font-weight: 500;
    color: #111827;
}

.submission-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: #6b7280;
}

.empty-state svg {
    margin-bottom: 1rem;
    color: #9ca3af;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

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

.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
    }

    .submissions-table-wrapper {
        overflow-x: auto;
    }

    .submissions-table {
        min-width: 800px;
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #24292e;
}

/* Header styles */
.header {
    border-bottom: 1px solid #e1e4e8;
    padding: 16px 0;
    background: white;
}

.navbar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #24292e;
    text-decoration: none;
}

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

.nav-links a {
    color: #24292e;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    color: #0366d6;
}

/* Main content styles */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px;
}

/* Hero section */
.hero-section {
    text-align: center;
    margin-bottom: 64px;
}

h1 {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #24292e;
}

.hero-description {
    font-size: 20px;
    color: #586069;
    max-width: 800px;
    margin: 0 auto 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
}

.button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
}

.button-primary {
    background-color: #24292e;
    color: white;
}

.button-primary:hover {
    background-color: #000000;
}

.button-secondary {
    color: #24292e;
}

.button-secondary:hover {
    color: #0366d6;
}

/* Features section */
.features-section {
    margin-top: 64px;
}

h2 {
    font-size: 36px;
    text-align: center;
    margin-bottom: 48px;
    color: #24292e;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 64px;
}

.feature-card {
    padding: 24px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    background: white;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #24292e;
}

.feature-card p {
    color: #586069;
    font-size: 16px;
}

/* CTA section */
.cta-section {
    text-align: center;
    margin-top: 64px;
    padding: 64px 0;
    background: #f6f8fa;
    border-radius: 8px;
}

.cta-section h2 {
    margin-bottom: 24px;
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }

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

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 16px;
}

/* Templates */
/* Add to public/css/styles.css */

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.template-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #000;
    transform: translateY(-2px);
}

.template-preview {
    flex-grow: 1;
}

.template-preview h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.template-badge {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.template-fields {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.template-field {
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.template-field-more {
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.875rem;
    padding: 0.5rem;
}

.template-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.template-actions .btn {
    flex: 1;
}

/* Template Preview Modal */
#template-preview-form {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.375rem;
}

#template-preview-form .field-wrapper {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

#template-preview-form .field-wrapper:last-child {
    margin-bottom: 0;
}

.modal-body {
    padding: 1.5rem;
}

@media (max-width: 640px) {
    .template-actions {
        flex-direction: column;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* Account */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.settings-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.settings-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin: -1rem;
    border-radius: 0.5rem;
    transition: background-color 0.15s;
}

.info-row:hover {
    background-color: #f9fafb;
}

.info-row label {
    font-weight: 500;
    color: #374151;
    width: 120px;
}

.info-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.info-content span {
    color: #111827;
}

.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.subscription-info p {
    color: #6b7280;
    font-size: 0.875rem;
}

.text-secondary {
    color: #6b7280;
}

.upgrade-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.upgrade-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upgrade-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.upgrade-features li svg {
    width: 16px;
    height: 16px;
    color: #10b981;
}

.btn-upgrade {
    background: #111827;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.15s;
}

.btn-upgrade:hover {
    background: #1f2937;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.plan-badge.pro {
    background: #dcfce7;
    color: #166534;
}

.pro-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    margin-left: 0.5rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover .pro-badge {
    background-color: #e5e7eb;
}

/* Embed forms */
.code-wrapper {
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
}

.code-wrapper pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.875rem;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.modal-note {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Webhooks for Pro only */
.pro-feature-wrapper {
    position: relative;
}

.pro-disabled {
    background-color: #f9fafb;
    cursor: not-allowed;
}

.btn-upgrade-inline {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    font-size: 12px;
    background: #f3f4f6;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-upgrade-inline:hover {
    background: #e5e7eb;
}

.pro-feature-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Update existing pro-badge style */
.pro-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 4px;
    background-color: #f3f4f6;
    border-radius: 9999px;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-upgrade-inline:hover .pro-badge {
    background-color: #d1d5db;
}

/* Delete form */
/* Add this to public/css/styles.css */

.delete-confirmation {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #FEE2E2;
    border-radius: 0.5rem;
    border: 1px solid #FCA5A5;
}

.delete-confirmation p {
    color: #991B1B;
    margin-bottom: 0.5rem;
}

.delete-confirmation strong {
    font-weight: 600;
    word-break: break-all;
}

.delete-confirmation input {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid #FCA5A5;
    border-radius: 0.375rem;
    color: #DC2626;
}

.delete-confirmation input:focus {
    outline: none;
    border-color: #DC2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.btn.bg-red-600 {
    background-color: #DC2626;
    border-color: #DC2626;
}

.btn.bg-red-600:hover {
    background-color: #B91C1C;
    border-color: #B91C1C;
}

.btn.bg-red-600:disabled {
    background-color: #FCA5A5;
    border-color: #FCA5A5;
    cursor: not-allowed;
}

/* Manage form */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 160px;
    z-index: 50;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #374151;
    font-size: 0.875rem;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item svg {
    color: #6b7280;
}

.dropdown-item:hover svg {
    color: #374151;
}

/* Hidden fields */
.hidden-field-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.hidden-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

.hidden-field-label svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

/* Remove the value display since we don't need placeholders */
.hidden-field-value {
    display: none;
}

/* Selects *//* GitHub-style select dropdowns */
select,
.field-select {
    appearance: none;
    background-color: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    color: #24292f;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    min-height: 32px;
    padding: 5px 12px;
    padding-right: 32px; /* Space for the arrow */
    position: relative;
    user-select: none;
    vertical-align: middle;
    white-space: nowrap;
    width: 100%;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.427 5.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 5H4.604a.25.25 0 00-.177.427z' fill='%236e7781'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    max-width: 100%;
}

select:hover,
.field-select:hover {
    background-color: #f6f8fa;
    border-color: #afb8c1;
    transition: border-color .15s ease-in-out;
}

select:focus,
.field-select:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
    outline: none;
}

/* Style for the options */
select option,
.field-select option {
    background-color: #fff;
    color: #24292f;
    padding: 8px 12px;
    font-size: 14px;
}

/* Remove default styling on Firefox */
select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #24292f;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    select,
    .field-select {
        font-size: 16px; /* Prevent auto-zoom on iOS */
        min-height: 40px; /* Larger touch target */
        padding: 8px 12px;
        padding-right: 32px;
    }
}

/* Disabled state */
select:disabled,
.field-select:disabled {
    background-color: #f6f8fa;
    border-color: #d0d7de;
    color: #8c959f;
    cursor: not-allowed;
}

/* Container styles for select fields */
.field-wrapper {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #24292f;
    margin-bottom: 8px;
}

/* Required field indicator */
.required {
    color: #cf222e;
    margin-left: 4px;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 40px 0;
    font-size: 12px;
    color: #6e7781;
    border-top: 1px solid #d0d7de;
}

.footer .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

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

.footer-link {
    color: #0969da;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
    color: #0969da;
}

.footer-copyright {
    color: #6e7781;
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}