/* Pages Management Styles */

.main-content {
    min-height: calc(100vh - 80px);
    background: #f9fafb;
    padding: 24px;
}

.pages-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.pages-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left h1.pages-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.pages-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 12px;
}

.btn-primary {
    padding: 10px 20px;
    background: #3c82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Tabs Navigation */
.pages-tabs {
    display: flex;
    gap: 0;
    background: transparent;
    margin-bottom: 0;
    padding: 12px 0 0 0;
}

.pages-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    margin-left: 0;
    margin-right: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pages-tab:hover {
    background: #F9FAFB;
    border-radius: 8px 8px 0 0;
}

.pages-tab.active {
    color: #374151;
    background: white;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    position: relative;
    z-index: 10;
}

.pages-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #6366f1;
}

.tab-count {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    background: #F3F4F6;
    color: #6B7280;
}

.pages-tab.active .tab-count {
    background: #E0E7FF;
    color: #6366f1;
}

.pages-tab-content {
    display: none;
    background: white;
    border-radius: 0 12px 12px 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

/* Domains List Styles */
.domains-container {
    min-height: 400px;
}

/* Domains Table Styles */
.domains-table-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}

.domains-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.domains-table thead {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.domains-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.domains-table th:last-child {
    text-align: right;
}

.domains-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.domains-table tbody tr:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.domains-table tbody tr:last-child {
    border-bottom: none;
}

.domains-table td {
    padding: 16px 20px;
    vertical-align: middle;
}

.domain-name-cell {
    min-width: 200px;
}

.domain-name-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.domain-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.domain-status-cell {
    white-space: nowrap;
}

.domain-ssl-cell {
    white-space: nowrap;
}

.domain-pages-cell {
    white-space: nowrap;
    text-align: center;
}

.domain-pages-count {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.domain-verified-cell {
    white-space: nowrap;
}

.domain-actions-cell {
    text-align: right;
}

.domain-details-row {
    background: #f9fafb;
}

.domain-details-row td {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.domain-details-content {
    padding: 0;
}

.domain-row[data-expanded="true"] {
    background: #f9fafb;
}

/* Legacy domain-card styles for backward compatibility */
.domain-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.domain-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #D1D5DB;
}

.domain-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.2s ease;
}

.domain-card-header:hover {
    background-color: #F9FAFB;
}

.domain-card-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.domain-card-toggle {
    transition: transform 0.2s ease;
    color: #6B7280;
}

.domain-card[data-expanded="true"] .domain-card-toggle,
.domain-card .domain-card-header[aria-expanded="true"] ~ .domain-card-toggle {
    transform: rotate(180deg);
}

.domain-details {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background-color: #F9FAFB;
}

.domain-dns-instructions {
    margin-top: 8px;
}

.dns-instructions-section {
    margin-top: 16px;
}

.dns-instructions-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.dns-instructions-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px 0;
}

.dns-instructions-intro {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 16px 0;
}

.dns-record-box {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.dns-record-box p {
    font-size: 14px;
    color: #374151;
    margin: 8px 0;
}

.dns-record-box code.dns-value {
    display: inline-block;
    background: #F3F4F6;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #111827;
    word-break: break-all;
}

.dns-note {
    font-size: 13px;
    color: #6B7280;
    font-style: italic;
    margin-top: 12px !important;
}

.dns-copy-section {
    margin-top: 12px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    background: #3c82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-small:hover {
    background: #2563eb;
}

.loading-state-small {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: #6B7280;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #E5E7EB;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.error-state-small {
    padding: 16px;
    color: #DC2626;
    font-size: 14px;
}

.domain-card-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    flex-wrap: wrap;
}

.domain-card-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
}

.domain-card-actions .btn-secondary:hover {
    background: #E5E7EB;
    border-color: #9CA3AF;
}

.domain-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.domain-name {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.domain-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.domain-status-badge.verified {
    background: #D1FAE5;
    color: #065F46;
}

.domain-status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.domain-status-badge.failed {
    background: #FEE2E2;
    color: #991B1B;
}

.domain-ssl-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.domain-ssl-badge.ssl-active {
    background: #d1fae5;
    color: #065f46;
}

.domain-ssl-badge.ssl-pending {
    background: #fef3c7;
    color: #92400e;
}

.domain-ssl-badge.ssl-none {
    background: #fee2e2;
    color: #991b1b;
}

.domain-ssl-badge.ssl-error {
    background: #f3f4f6;
    color: #6b7280;
}

.spinner-small-inline {
    width: 12px;
    height: 12px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.domain-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.domain-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6B7280;
}

.domain-info-item strong {
    color: #374151;
    min-width: 100px;
}

.domain-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.domain-card-actions .btn-icon.danger {
    color: #DC2626;
}

.domain-card-actions .btn-icon.danger:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #991B1B;
}

.domain-card-actions .btn-icon {
    padding: 8px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.domain-card-actions .btn-icon:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

/* Filters */
.pages-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    min-width: 200px;
    transition: border-color 0.2s ease;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input {
    min-width: 300px;
}

/* Pages List */
.pages-list-container {
    background: #ffffff;
    border-radius: 12px;

    min-height: 400px;
}

.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.empty-state svg {
    color: #9ca3af;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

/* Pages Table */
.pages-table-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}

.pages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pages-table thead {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.pages-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.pages-table th:last-child {
    text-align: right;
}

.pages-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.pages-table tbody tr:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pages-table tbody tr:last-child {
    border-bottom: none;
}

.pages-table td {
    padding: 16px 20px;
    vertical-align: top;
}

.page-name-cell {
    min-width: 300px;
}

.page-name-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shared-badge {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    background: #D1FAE5;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 8px;
}

.page-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-table-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.page-table-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.page-url-display {
    margin-top: 4px;
}

.page-url-link {
    font-size: 12px;
    color: #6366f1;
    text-decoration: none;
    font-family: 'Monaco', 'Courier New', monospace;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.page-url-placeholder {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.page-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.page-status-badge.published {
    background: #d1fae5;
    color: #065f46;
}

.page-status-badge.draft {
    background: #f3f4f6;
    color: #6b7280;
}

.page-status-cell {
    white-space: nowrap;
}

.page-views-cell {
    white-space: nowrap;
}

.page-views-count {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.page-time-cell {
    white-space: nowrap;
}

.time-ago {
    font-size: 14px;
    color: #6b7280;
}

.page-actions-cell {
    text-align: right;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    position: relative;
    flex-wrap: wrap;
}

.table-action-btn {
    padding: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    position: relative;
}

.btn-verify {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.table-action-btn:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151;
}

.table-action-btn.delete:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Tooltip styling - using JavaScript for positioning */
.table-action-btn[title] {
    position: relative;
}

.table-action-tooltip {
    position: fixed;
    padding: 6px 10px;
    background: #111827;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    pointer-events: none;
    z-index: 99999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.table-action-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #111827;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Responsive table */
@media (max-width: 768px) {
    .pages-table-container {
        border-radius: 12px;
        overflow-x: auto;
    }

    .pages-table {
        min-width: 600px;
    }

    .pages-table th,
    .pages-table td {
        padding: 12px 16px;
    }

    .pages-table th {
        font-size: 12px;
    }

    .page-table-title {
        font-size: 15px;
    }

    .page-table-description {
        font-size: 12px;
    }

    .domains-table-container {
        border-radius: 12px;
        overflow-x: auto;
    }

    .domains-table {
        min-width: 600px;
    }

    .domains-table th,
    .domains-table td {
        padding: 12px 16px;
    }

    .domains-table th {
        font-size: 12px;
    }

    .domain-name {
        font-size: 15px;
    }
}

.btn-secondary {
    padding: 8px 16px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-content-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 200px);
}

/* Status Modal Tabs */
.status-modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
    padding-bottom: 0;
}

.status-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    position: relative;
}

.status-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.status-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    font-weight: 600;
}

.status-tab-content {
    display: none;
}

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

/* Analytics Styles */
.analytics-section {
    margin-bottom: 2rem;
}

.analytics-section:last-child {
    margin-bottom: 0;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.analytics-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.analytics-card-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.analytics-card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.analytics-list {
    margin-top: 1rem;
}

.analytics-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.analytics-list-label {
    color: #374151;
    font-size: 0.875rem;
}

.analytics-list-value {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.analytics-table {
    margin-top: 1rem;
    overflow-x: auto;
}

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

.analytics-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.analytics-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
}

.analytics-table tbody tr:hover {
    background: #f9fafb;
}

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

.modal-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

.create-blank-page-section {
    margin-bottom: 24px;
}

.guides-section {
    margin-top: 24px;
}

.guides-section .form-group {
    margin-bottom: 16px;
}

.guides-section .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guides-section .form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

.modal-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #9ca3af;
    font-size: 14px;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.modal-divider span {
    padding: 0 16px;
}

.spinner-small-inline {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.guides-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.guide-item {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guide-item:hover {
    border-color: #6366f1;
    background: #f9fafb;
}

.guide-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.guide-item-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Settings Modal Styles */
.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.settings-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-help {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.domain-status-section {
    margin: 24px 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.domain-info {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.domain-status-info {
    margin-bottom: 16px;
}

.domain-status-info p {
    font-size: 14px;
    color: #374151;
    margin: 8px 0;
}

.domain-status-info p strong {
    font-weight: 600;
    color: #111827;
}

.domain-status-info.verified {
    color: #065f46;
}

.domain-status-info.verified p {
    color: #065f46;
}

.domain-status-info.pending {
    color: #92400e;
}

.domain-status-info.pending p {
    color: #92400e;
}

.domain-status-info.failed {
    color: #991b1b;
}

.domain-status-info.failed p {
    color: #991b1b;
}

.domain-status-info a {
    color: #6366f1;
    text-decoration: none;
}

.domain-status-info a:hover {
    text-decoration: underline;
}

.domain-instructions {
    margin-top: 20px;
    padding: 16px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.domain-instructions.routing-instructions {
    background: #f0f9ff;
    border-color: #6366f1;
}

.domain-instructions h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}

.dns-record-box {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.dns-record-box p {
    margin: 6px 0;
    color: #374151;
}

.dns-record-box code {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    color: #6366f1;
    font-weight: 600;
}

.dns-note {
    font-size: 12px;
    color: #6b7280;
    margin: 12px 0 0 0;
    font-style: italic;
}

.dns-instructions-intro {
    font-size: 14px;
    color: #374151;
    margin: 0 0 16px 0;
}

.dns-instructions-note {
    font-size: 13px;
    color: #6366f1;
    font-weight: 500;
    margin: 12px 0;
    padding: 8px 12px;
    background: #eef2ff;
    border-radius: 4px;
    border-left: 3px solid #6366f1;
}

.dns-copy-section {
    margin: 12px 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.error-state {
    padding: 20px;
    text-align: center;
    color: #991b1b;
}

.error-state p {
    margin: 0;
    font-size: 14px;
}

/* Submissions Modal Styles */
.submissions-summary {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.submissions-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-export-all {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6366f1;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export-all:hover {
    background: #f9fafb;
    border-color: #3c82f6;
    color: #2563eb;
}

.btn-export-all svg {
    display: inline-block;
    vertical-align: middle;
}

.summary-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: #f9fafb;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    min-width: 150px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.form-submissions-section {
    margin-bottom: 32px;
}

.form-submissions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.form-submissions-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-export-form {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #6366f1;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export-form:hover {
    background: #f9fafb;
    border-color: #3c82f6;
    color: #2563eb;
}

.btn-export-form svg {
    display: inline-block;
    vertical-align: middle;
}

.form-submissions-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.form-name-editable {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.form-name-input {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    color: #1f2937 !important;
    width: 100% !important;
    max-width: 400px !important;
    border-bottom: 2px solid transparent !important;
    transition: border-color 0.2s ease !important;
}

.form-name-input:focus {
    outline: none !important;
    border-bottom-color: #6366f1 !important;
}

.form-name-input::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}

.form-name-input.form-name-placeholder::placeholder {
    color: #6366f1 !important;
    font-weight: 500 !important;
}

.btn-save-form-name {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    background: #6366f1;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-form-name:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.btn-save-form-name:active {
    transform: scale(0.95);
}

.submission-count-badge {
    background: #6366f1;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.submission-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.submission-item:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.submission-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.submission-number {
    font-weight: 600;
    color: #6366f1;
    font-size: 14px;
}

.submission-date {
    font-size: 13px;
    color: #6b7280;
    flex: 1;
}

.webhook-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.webhook-status.success {
    background: #d1fae5;
    color: #065f46;
}

.webhook-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.submission-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.submission-field {
    display: flex;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.submission-field strong {
    font-weight: 600;
    color: #374151;
    min-width: 120px;
}

.submission-field span {
    color: #111827;
    flex: 1;
}

.no-submissions {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
}

/* Submissions Table Styles */
.submissions-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
}

.submissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.submissions-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.submissions-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.submissions-table th.col-number {
    width: 60px;
    text-align: center;
}

.submissions-table th.col-date {
    width: 180px;
}

.submissions-table th.col-ip {
    width: 140px;
}

.submissions-table th.col-location {
    width: 220px;
}

.submissions-table th.col-status {
    width: 100px;
    text-align: center;
}

.submissions-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

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

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

.submissions-table td {
    padding: 12px 16px;
    color: #111827;
    vertical-align: top;
}

.submissions-table td.col-number {
    text-align: center;
    font-weight: 600;
    color: #6366f1;
    font-size: 13px;
}

.submissions-table td.col-date {
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}

.submissions-table td.col-ip {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.submissions-table td.col-location {
    font-size: 13px;
    color: #374151;
    max-width: 220px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.submissions-table td.col-field {
    max-width: 300px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.submissions-table td.col-status {
    text-align: center;
}

.submissions-table .webhook-status {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.submissions-table .webhook-status.success {
    background: #d1fae5;
    color: #065f46;
}

.submissions-table .webhook-status.error {
    background: #fee2e2;
    color: #991b1b;
    cursor: help;
}

.submissions-table .webhook-status:not(.success):not(.error) {
    color: #9ca3af;
}

.table-action-btn.submissions {
    color: #3c82f6;
}

.table-action-btn.submissions:hover {
    background: #eef2ff;
    color: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .pages-header {
        flex-direction: column;
        gap: 16px;
    }

    .pages-filters {
        flex-direction: column;
    }

    .filter-select, .filter-input {
        min-width: 100%;
    }
}

/* Folder Sidebar Styles */
.pages-content-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.folder-sidebar {
    width: 240px;
    min-width: 240px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.folder-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: none;
}

.folder-sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #F3F4F6;
    color: #111827;
}

.folder-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    font-size: 14px;
    position: relative;
    padding-right: 60px; /* Space for count/actions on the right */
}

.folder-item:hover {
    background: #F9FAFB;
}

.folder-item.active {
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 500;
}

.folder-item svg {
    flex-shrink: 0;
    color: inherit;
}

.folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Allow flex item to shrink */
}

.folder-count {
    font-size: 12px;
    color: #9CA3AF;
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.folder-item.active .folder-count {
    background: #DBEAFE;
    color: #2563EB;
}

.folder-item:hover .folder-count {
    opacity: 0;
}

.folder-toggle {
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.folder-toggle.expanded {
    transform: rotate(90deg);
}

.folder-toggle-spacer {
    width: 5px;
    flex-shrink: 0;
}

.folder-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.folder-item:hover .folder-actions {
    opacity: 1;
    pointer-events: auto;
}

.btn-icon-small {
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    border-radius: 4px;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.btn-icon-small:hover {
    background: #F3F4F6;
    color: #111827;
}

.folder-actions .btn-icon-small:last-child:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.folder-children {
    margin-left: 12px;
    margin-top: 4px;
}

.folder-item-wrapper {
    display: flex;
    flex-direction: column;
}

.pages-main-content {
    flex: 1;
    min-width: 0;
}

/* Move Folder Modal Styles */
.move-folder-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 8px;
}

.move-folder-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    font-size: 14px;
}

.move-folder-option:hover {
    background: #F9FAFB;
}

.move-folder-option svg {
    flex-shrink: 0;
    color: #6B7280;
}

/* Responsive */
@media (max-width: 768px) {
    .pages-content-layout {
        flex-direction: column;
    }

    .folder-sidebar {
        width: 100%;
        min-width: auto;
        position: static;
        max-height: none;
    }
}

