/* ========================================
   seoMap by Andrea Papa - Main Stylesheet
   ======================================== */

/* ========================================
   RESET & 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: #1e293b;
    background: #f8fafc;
    overflow-x: hidden;
}

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4D3FD7 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   MODAL STYLES
   ======================================== */

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

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    margin-bottom: 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

/* ========================================
   FORM STYLES
   ======================================== */

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

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

/* ========================================
   BUTTON STYLES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    gap: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: #4D3FD7;
    color: white;
    box-shadow: 0 4px 14px rgba(77, 63, 215, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 63, 215, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(77, 63, 215, 0.3);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    border-radius: 10px;
    gap: 0.375rem;
}

/* ========================================
   APP LAYOUT
   ======================================== */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0;
    position: relative;
}

/* Main Navigation Buttons */
.main-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-right: 1rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

.nav-btn.active {
    background: #4D3FD7;
    color: white;
    font-weight: 600;
}

.nav-btn.active:hover {
    background: #4338ca;
}

.header-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    min-height: 3rem;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
}

.logo h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.logo p {
    font-size: 0.7rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
    line-height: 1.2;
}

.user-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem;
    min-width: 0;
    flex-shrink: 0;
    white-space: nowrap;
    flex-wrap: nowrap !important;
    padding: 0.5rem 0;
}

/* Action Bar Styles */
.action-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1rem;
    display: none;
}

.action-bar.active {
    display: block;
}

.action-tabs {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
}

.action-tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    font-weight: 500;
    color: #64748b;
    font-size: 0.875rem;
    white-space: nowrap;
    background: none;
    border: none;
    border-radius: 4px 4px 0 0;
}

.action-tab:hover {
    color: #4D3FD7;
    background: rgba(79, 70, 229, 0.05);
}

.action-tab.active {
    color: #4D3FD7;
    border-bottom-color: #4D3FD7;
    background: rgba(79, 70, 229, 0.05);
    font-weight: 600;
}

/* Projektselektor Container */
.project-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.15s ease;
}

.project-selector-container:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.project-selector-container:focus-within {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Projektselektor im Header - verbessert */
.user-info #global-project-selector {
    background: transparent;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    min-width: 180px;
    padding: 0;
    outline: none;
    cursor: pointer;
}

.user-info #global-project-selector:focus {
    outline: none;
}

/* User Details Container */
.user-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid #e2e8f0;
}

/* Header Buttons - alle gleich */
.user-info .btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
    margin: 0 0.25rem;
}

/* User Name im Header */
.user-info #user-email {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    min-width: 0;
    padding: 0 0.5rem;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-tabs {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 2.75rem;
}

.tabs {
    display: flex;
    gap: 1rem;
}

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

.tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    font-weight: 500;
    color: #64748b;
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
    margin-bottom: -1px;
}

.tab:hover {
    color: #667eea;
    background: #f8fafc;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8fafc;
    font-weight: 600;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main {
    flex: 1;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
}

.tab-content {
    display: none;
}

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

/* ========================================
   CARD STYLES
   ======================================== */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

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

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-state h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* ========================================
   PROJECTS GRID
   ======================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
    width: 100%;
    justify-items: start;
}

.project-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

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

.project-actions {
    display: flex;
    gap: 4px;
}

.project-action-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 0.8rem;
}

.project-action-btn:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

/* Project details now styled inline for better control */

.project-country,
.project-website {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.project-label {
    font-weight: 600;
    color: #64748b;
    margin-right: 0.5rem;
    min-width: 4rem;
}

.project-value {
    color: #1e293b;
}

.project-value a {
    color: #667eea;
    text-decoration: none;
}

.project-value a:hover {
    text-decoration: underline;
}

.project-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.project-badge.keywords {
    background: #f3e8ff;
    color: #4D3FD7;
}

.project-badge.clusters {
    background: #f0fdf4;
    color: #166534;
}

.project-badge.authority {
    background: #fef3c7;
    color: #92400e;
}

.project-badge:hover {
    transform: scale(1.05);
}

/* ========================================
   KEYWORDS TABLE
   ======================================== */

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

.keywords-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
}

.keywords-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.keywords-table tr:hover {
    background: #f8fafc;
}

.keywords-table tr.selected {
    background: #f3e8ff;
}

/* ========================================
   CLUSTERING STYLES
   ======================================== */

.clustering-container {
    padding: 2rem;
}

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

.cluster-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    position: relative;
}

.cluster-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.cluster-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.cluster-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.cluster-actions {
    display: flex;
    gap: 0.5rem;
}

.cluster-action-btn {
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.cluster-action-btn:hover {
    background: #f1f5f9;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.keyword-chip {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
}

/* ========================================
   SERP OVERLAY
   ======================================== */

.serp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.serp-overlay.show {
    display: flex;
}

.serp-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.serp-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.serp-search {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
}

.serp-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ========================================
   SERP OVERLAY STYLES
   ======================================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.overlay-header h2 {
    margin: 0;
    color: #1e293b;
}

.serp-overlay-body {
    padding: 2rem;
}

.keywords-selection-section {
    margin-bottom: 2rem;
}

.keywords-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    min-height: 80px;
    align-items: flex-start;
    flex-wrap: wrap;
    max-height: 200px;
    overflow-y: auto;
}

.keyword-chip {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.keyword-chip:hover {
    border-color: #667eea;
    background: #f1f5f9;
}

.keyword-chip.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.serp-results-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
}

.serp-content {
    min-height: 300px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    padding: 1rem;
}

.serp-results-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.serp-result-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

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

.serp-result-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1rem;
}

.serp-loading {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}

.serp-results {
    padding: 1rem;
}

.serp-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.serp-entries {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.serp-entry {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.serp-entry:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.serp-entry.own-website {
    border-color: #10b981;
    background: #f0fdf4;
}

.serp-position {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.serp-entry.own-website .serp-position {
    background: #10b981;
    color: white;
}

.serp-details {
    flex: 1;
    min-width: 0;
}

.serp-details h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.serp-url {
    font-size: 0.75rem;
    color: #10b981;
    margin-bottom: 0.25rem;
}

.serp-snippet {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.serp-error {
    text-align: center;
    color: #ef4444;
    padding: 2rem;
}

.serp-no-results {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}

/* SERP Card Styles */
.serp-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
    overflow: hidden;
}

.serp-card-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.serp-result {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.serp-result:last-child {
    border-bottom: none;
}

.serp-result.own-website {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
}

.serp-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.serp-url {
    font-size: 0.75rem;
    color: #10b981;
    margin-bottom: 0.25rem;
}

.serp-description {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

/* SERP Search Highlights */
.serp-highlight {
    background: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    font-weight: 600;
}

.serp-highlight.current {
    background: #fbbf24;
    color: #92400e;
}

/* Enhanced SERP Features */
.serp-featured-snippet {
    border-left: 4px solid #4D3FD7;
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
}

.serp-knowledge-graph {
    border-left: 4px solid #8b5cf6;
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
}

.serp-people-ask {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.serp-result-checkbox {
    accent-color: #4D3FD7;
}

.serp-result-checkbox:checked + .serp-position {
    background: #4D3FD7 !important;
    color: white !important;
}

.btn-small {
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

/* Bulk Actions Menu */
.bulk-actions-menu {
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========================================
   DROPUP STYLES
   ======================================== */

.dropup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e2e8f0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 1500;
    height: 70vh;
    max-height: 70vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    visibility: hidden;
}

.dropup.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.dropup-body {
    padding: 0.75rem;
    height: calc(70vh - 80px);
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.keywords-horizontal-selector {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.375rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    width: 100%;
}

.keywords-horizontal-selector::-webkit-scrollbar {
    height: 6px;
}

.keywords-horizontal-selector::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.keywords-horizontal-selector::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.keywords-horizontal-selector::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.keyword-chip {
    display: inline-flex !important;
    align-items: center;
    padding: 0.375rem 0.625rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    font-weight: 500;
    min-width: max-content !important;
}

.keyword-chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.keyword-chip.selected {
    background: #4D3FD7;
    border-color: #4D3FD7;
    color: white;
}

.keyword-chip.selected:hover {
    background: #4D3FD7;
}

.serp-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.serp-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    min-width: 320px;
    max-width: 400px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    height: auto;
}

.serp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.serp-result {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: all 0.2s ease !important;
    border-radius: 6px !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.serp-result:hover {
    background: #f8fafc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.serp-result.own-website {
    background: #fef3c7 !important;
    border-left: 4px solid #f59e0b !important;
    border-color: #f59e0b !important;
}

.serp-title {
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin-bottom: 0.375rem !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    cursor: pointer !important;
    display: block !important;
}

.serp-title:hover {
    color: #4D3FD7 !important;
    text-decoration: underline !important;
}

.serp-url {
    color: #059669 !important;
    font-size: 0.75rem !important;
    margin-bottom: 0.375rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    display: block !important;
}

.serp-description {
    color: #6b7280 !important;
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin-bottom: 0.25rem !important;
}

.serp-no-results {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

.dropup-drag-handle {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 8px auto 0 auto;
    cursor: grab;
    transition: background-color 0.2s ease;
}

.dropup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dropup-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.dropup-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    transition: color 0.2s;
}

.dropup-header .close-btn:hover {
    color: #ef4444;
}

.dropup-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.dropup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Horizontal Control Bar Styles */
.dropup-horizontal-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dropup-horizontal-bar input[type="text"] {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dropup-horizontal-bar input[type="text"]:focus {
    outline: none;
    border-color: #4D3FD7;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dropup-horizontal-bar button:hover:not(:disabled) {
    background: #e2e8f0 !important;
}

.dropup-horizontal-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Keyword Chips Styles */
.keywords-horizontal-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    user-select: none;
}

.keyword-chip:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.keyword-chip.selected {
    background: #4D3FD7;
    color: white;
    border-color: #4D3FD7;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.keyword-chip.selected:hover {
    background: #4D3FD7;
    transform: translateY(-1px);
}

.keyword-chip span {
    white-space: nowrap;
}

.dropup-drag-handle:hover {
    background: #94a3b8;
}

.dropup-drag-handle:active {
    cursor: grabbing;
    background: #64748b;
}

.dropup-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.dropup-content {
    padding: 2rem;
}

.dropup-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 3000;
    max-width: 400px;
    display: none;
}

.toast.show {
    display: block;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #4D3FD7;
}

/* ========================================
   AUTHORITY BUILDER
   ======================================== */

.authority-builder {
    display: flex;
    height: calc(100vh - 200px);
    gap: 2rem;
}

.authority-sidebar {
    width: 300px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.sidebar-search {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.authority-canvas {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.authority-drop-zone {
    min-height: 100%;
    padding: 2rem;
}

/* ========================================
   DRAG & DROP
   ======================================== */

.draggable-item {
    cursor: grab;
    transition: all 0.2s;
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drop-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: #f3e8ff;
}

/* ========================================
   TIMELINE PANEL
   ======================================== */

.timeline-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.timeline-panel.show {
    display: flex;
}

.timeline-panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.timeline-panel-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* ========================================
   CONTENT EDITOR PANEL
   ======================================== */

.content-editor-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 500px;
    height: 100vh;
    background: white;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.content-editor-panel.show {
    display: flex;
}

.content-editor-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.content-editor-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.content-editor-textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
}

.content-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

/* ========================================
   MISSING CSS CLASSES
   ======================================== */

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

.keyword-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.keyword-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.keyword-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.keyword-card p {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.keyword-card small {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Manual Verification Dropup */
.manual-verification-dropup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

.manual-verification-dropup.show {
    display: block;
}

.dropup-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dropup-body {
    padding: 2rem;
}

/* Keywords Horizontal Selector */
.keywords-horizontal-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.keywords-horizontal-selector::-webkit-scrollbar {
    height: 6px;
}

.keywords-horizontal-selector::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.keywords-horizontal-selector::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.keywords-horizontal-selector::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Authority Builder */
.authority-builder {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: calc(100vh - 200px);
}

.authority-sidebar {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.sidebar-search {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.authority-canvas {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.authority-drop-zone {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    margin: 1rem;
    transition: all 0.2s;
}

.authority-drop-zone.drag-over {
    border-color: #667eea;
    background: #f3e8ff;
}

/* Cluster Drag Items */
.cluster-drag-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.cluster-drag-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.cluster-drag-item:active {
    cursor: grabbing;
}

.cluster-drag-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.cluster-drag-container {
    max-height: 300px;
    overflow-y: auto;
}

/* Authority Hierarchy Items */
.authority-hierarchy-item {
    background: linear-gradient(135deg, #4D3FD7 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.authority-hierarchy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.authority-hierarchy-item.level-0 {
    background: linear-gradient(135deg, #4D3FD7 0%, #764ba2 100%);
}

.authority-hierarchy-item.level-1 {
    background: linear-gradient(135deg, #4D3FD7 0%, #a855f7 100%);
    margin-left: 2rem;
}

.authority-hierarchy-item.level-2 {
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    margin-left: 4rem;
}

.authority-hierarchy-item.level-3 {
    background: linear-gradient(135deg, #c084fc 0%, #d8b4fe 100%);
    margin-left: 6rem;
}

/* ========================================
   USER MANAGEMENT STYLES
   ======================================== */

.user-management-table,
.invitations-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-management-table th,
.user-management-table td,
.invitations-table th,
.invitations-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.user-management-table th,
.invitations-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.user-row.suspended {
    opacity: 0.6;
    background: #fef2f2;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: #1f2937;
}

.user-email {
    color: #6b7280;
    font-size: 0.875rem;
}

.user-role-badge,
.role-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-superadmin {
    background: #4D3FD7;
    color: white;
}

.role-seo {
    background: #10b981;
    color: white;
}

.role-readonly {
    background: #6b7280;
    color: white;
}

.status-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

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

.user-actions,
.invitation-actions {
    display: flex;
    gap: 0.25rem;
}

.role-selector {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.role-selector:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.mini-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.mini-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: #64748b;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mini-tab.active {
    color: #4D3FD7;
    border-bottom-color: #4D3FD7;
    font-weight: 600;
}

.mini-tab:hover:not(.active) {
    color: #374151;
}

.invitation-row.expired {
    opacity: 0.5;
    background: #fefbf2;
}

.expires-at.expired {
    color: #dc2626;
    font-weight: 600;
}

.last-login {
    color: #6b7280;
    font-size: 0.875rem;
}

.created-date,
.invited-by {
    color: #6b7280;
    font-size: 0.875rem;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.superadmin-only {
    display: none !important;
}

.superadmin-only.show {
    display: block !important;
}

.form-info {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    color: #0c4a6e;
    font-size: 0.875rem;
}

.form-info ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.form-info li {
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .user-management-table,
    .invitations-table {
        font-size: 0.875rem;
    }
    
    .user-management-table th,
    .user-management-table td,
    .invitations-table th,
    .invitations-table td {
        padding: 0.5rem;
    }
    
    .user-actions,
    .invitation-actions {
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .mini-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Show class for overlays */
.show {
    display: block !important;
}

/* Button icons */
.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    margin: 0 0.25rem;
}

.btn-icon:hover {
    background: #f1f5f9;
}

/* SERP Modal Styles */
.serp-modal-content {
    max-width: 800px;
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: right;
}

.serp-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.serp-header h4 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.serp-header p {
    margin: 0.25rem 0;
    color: #64748b;
}

.serp-mock-notice {
    color: #f59e0b !important;
    font-weight: 600;
    background: #fef3c7;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.serp-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.serp-result {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.serp-position {
    font-weight: bold;
    color: #667eea;
    font-size: 1.125rem;
    min-width: 2rem;
}

.serp-content {
    flex: 1;
}

.serp-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.serp-title a {
    color: #1a0dab;
    text-decoration: none;
}

.serp-title a:hover {
    text-decoration: underline;
}

.serp-url {
    color: #006621;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.serp-description {
    color: #545454;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

/* Keywords Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

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

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Filter Row */
.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #f3e8ff;
    border-bottom: 1px solid #e2e8f0;
}

.bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.bulk-actions-right {
    display: flex;
    gap: 0.5rem;
}

/* Enhanced Keywords Table */
.keywords-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.keywords-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.keywords-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.keywords-table tr:hover {
    background: #f8fafc;
}

.keywords-table tr.selected {
    background: #f3e8ff;
}

/* Position indicators */
.position-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    min-width: 2rem;
}

.position-badge.top3 {
    background: #10b981;
    color: white;
}

.position-badge.top10 {
    background: #f59e0b;
    color: white;
}

.position-badge.top20 {
    background: #ef4444;
    color: white;
}

.position-badge.untracked {
    background: #e5e7eb;
    color: #6b7280;
}

/* Volume indicators */
.volume-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
}

/* Trend arrows */
.trend-arrow {
    font-size: 1rem;
    margin-left: 0.25rem;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

.trend-stable {
    color: #6b7280;
}

/* Intent badges */
.intent-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.intent-badge.intent-informational {
    background: #e9d5ff;
    color: #1e40af;
}

.intent-badge.intent-navigational {
    background: #f3e8ff;
    color: #7c3aed;
}

.intent-badge.intent-commercial {
    background: #fef3c7;
    color: #d97706;
}

.intent-badge.intent-transactional {
    background: #dcfce7;
    color: #16a34a;
}

/* Toast variations */
.toast.success {
    background: #10b981;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.toast.info {
    background: #4D3FD7;
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .header-content, .nav-tabs {
        padding: 0 1.25rem;
    }
    
    .tab {
        padding: 0.45rem 0.875rem;
        font-size: 0.775rem;
    }
    
    .main {
        padding: 1.375rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 0.875rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.375rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-direction: row;
        gap: 0.5rem;
        min-height: 2.5rem;
        flex-wrap: wrap;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .logo p {
        font-size: 0.65rem;
    }
    
    .user-info {
        justify-content: flex-end;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        gap: 0.375rem;
    }
    
    .user-info #global-project-selector {
        min-width: 120px;
        max-width: 140px;
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
    }
    
    .user-info .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .user-info #user-email {
        font-size: 0.7rem;
    }
    
    .nav-tabs {
        padding: 0 1rem;
        min-height: 2.25rem;
    }
    
    .tabs {
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
        border-bottom-width: 2px;
    }
    
    .main {
        padding: 1rem;
    }
}
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .project-actions {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .cluster-grid-view {
        grid-template-columns: 1fr;
    }
    
    .authority-builder {
        flex-direction: column;
        height: auto;
    }
    
    .authority-sidebar {
        width: 100%;
    }
    
    .timeline-panel,
    .content-editor-panel {
        width: 100%;
        right: -100%;
    }
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

/* ========================================
   HORIZONTAL SCROLL
   ======================================== */

.cluster-horizontal-scroll,
.keywords-horizontal-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.cluster-horizontal-scroll::-webkit-scrollbar,
.keywords-horizontal-selector::-webkit-scrollbar {
    height: 6px;
}

.cluster-horizontal-scroll::-webkit-scrollbar-track,
.keywords-horizontal-selector::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.cluster-horizontal-scroll::-webkit-scrollbar-thumb,
.keywords-horizontal-selector::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.cluster-horizontal-scroll::-webkit-scrollbar-thumb:hover,
.keywords-horizontal-selector::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   KEYWORD CHIPS HORIZONTAL FORCE
   ======================================== */

/* Force horizontal layout for keywords - STRONGEST OVERRIDE */
#keywords-horizontal-scroll {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
}

#keywords-horizontal-scroll .keyword-chip {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    min-width: max-content !important;
}

/* SEO Crawler Styles */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #4D3FD7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 