/**
 * Campaign Designer - Modern CSS Stylesheet
 * Beautiful, vibrant, and responsive design
 */

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 90%;
}

:root {
    /* Professional Vibrant Color Palette */
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;

    --secondary: #DC2626;
    --secondary-light: #EF4444;
    --secondary-dark: #B91C1C;

    --accent: #7C3AED;
    --accent-light: #8B5CF6;
    --accent-dark: #6D28D9;

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    --background: #FFFFFF;
    --surface: #FFFFFF;
    --text: #111827;
    --text-muted: #6B7280;
    --border: #D1D5DB;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius - More geometric, less rounded */
    --radius-sm: 0.125rem;
    --radius-md: 0.25rem;
    --radius-lg: 0.375rem;
    --radius-xl: 0.5rem;

    /* Shadows - More subtle and professional */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.08), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Icon styles */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

.icon-xl {
    width: 2rem;
    height: 2rem;
}

/* ==================== TYPOGRAPHY ==================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Zalando Sans Expanded', 'Archivo', sans-serif;
    font-variation-settings: 'wdth' 125;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

.text-gradient {
    color: var(--primary);
    font-weight: 700;
}

.text-muted {
    color: var(--text-muted);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8125rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-block {
    width: 100%;
}

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

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 20px;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-gradient {
    background: var(--surface);
    border: 1px solid var(--border);
}

/* ==================== AUTH PAGES ==================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-xl);
}

.auth-card {
    position: relative;
    z-index: 101;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.auth-form {
    margin-bottom: var(--spacing-lg);
}

.auth-footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

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

.background-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
    z-index: 100;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    bottom: -250px;
    right: -250px;
    animation-delay: 7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {

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

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 71, 111, 0.1);
    border-left: 4px solid var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(6, 214, 160, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 214, 10, 0.1);
    border-left: 4px solid var(--warning);
    color: #B8860B;
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.layout-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 2px solid var(--border);
    padding: var(--spacing-xl);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: var(--spacing-xl);
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
    margin-bottom: var(--spacing-xs);
    display: block;
}

.sidebar-nav {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xl);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

/* ==================== DASHBOARD ==================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.campaign-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid var(--border);
    overflow: hidden;
    /* For image header */
    display: flex;
    flex-direction: column;
}

.campaign-card-header {
    height: 120px;
    background: #f3f4f6;
    background-size: cover;
    background-position: center;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.campaign-card-body {
    padding: var(--spacing-lg);
    flex: 1;
}

.campaign-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.campaign-card h3 {
    margin-bottom: var(--spacing-sm);
}

.campaign-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.campaign-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ==================== WIZARD ==================== */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-2xl);
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.wizard-step-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-sm);
    font-weight: 600;
    transition: var(--transition);
}

.wizard-step.active .wizard-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.wizard-step.completed .wizard-step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.wizard-step-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.wizard-step.active .wizard-step-label {
    color: var(--primary);
    font-weight: 600;
}

.wizard-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border);
}

/* ==================== LOADING ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }

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

    .wizard-steps {
        flex-wrap: wrap;
    }

    .wizard-step {
        flex-basis: 50%;
        margin-bottom: var(--spacing-lg);
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

/* ==================== UTILITIES ==================== */
.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mt-4 {
    margin-top: var(--spacing-xl);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.mb-4 {
    margin-bottom: var(--spacing-xl);
}

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

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

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--spacing-md);
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.modal-body {
    margin-bottom: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--border);
}

/* ==================== MARKDOWN EDITOR ==================== */
.markdown-editor-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.markdown-editor-tabs {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid var(--border);
}

.markdown-editor-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    margin-bottom: -2px;
}

.markdown-editor-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.markdown-editor-tab:hover {
    color: var(--text);
}

.markdown-editor-content {
    display: none;
}

.markdown-editor-content.active {
    display: block;
}

.markdown-editor-textarea {
    width: 100%;
    min-height: 300px;
    padding: var(--spacing-md);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    resize: vertical;
}

.markdown-preview {
    min-height: 300px;
    padding: var(--spacing-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow-y: auto;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.markdown-preview h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: var(--spacing-sm);
}

.markdown-preview h2 {
    font-size: 1.5rem;
}

.markdown-preview p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.markdown-preview ul,
.markdown-preview ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.markdown-preview li {
    margin-bottom: var(--spacing-xs);
}

.markdown-preview code {
    background: rgba(65, 105, 225, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-preview pre {
    background: rgba(65, 105, 225, 0.05);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

.markdown-preview pre code {
    background: none;
    padding: 0;
}

.markdown-preview blockquote {
    border-left: 4px solid var(--primary);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    color: var(--text-muted);
    font-style: italic;
}

.markdown-preview strong {
    font-weight: 600;
    color: var(--text);
}

.markdown-preview em {
    font-style: italic;
}

.markdown-preview a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-preview a:hover {
    text-decoration: underline;
}

/* ==================== ACTIVITIES DRAG & DROP ==================== */
.activities-timeline-container {
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.activities-timeline-header {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border);
}

.timeline-week {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    padding: var(--spacing-sm);
    background: rgba(65, 105, 225, 0.05);
    border-radius: var(--radius-sm);
}

.activities-grid {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.activities-week-column {
    flex: 1;
    min-height: 200px;
    padding: var(--spacing-sm);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(65, 105, 225, 0.02);
    transition: var(--transition);
}

.activities-week-column.drag-over-column {
    border-color: var(--primary);
    background: rgba(65, 105, 225, 0.1);
    border-style: solid;
}

.activity-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: 10px;
    cursor: move;
    transition: var(--transition);
    position: relative;
}

.activity-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.activity-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.activity-card.drag-over {
    border-color: var(--primary);
    background: rgba(65, 105, 225, 0.05);
    transform: scale(1.02);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-sm);
}

.activity-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(65, 105, 225, 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.activity-actions {
    display: flex;
    gap: 0.25rem;
}

.activity-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.activity-actions button:hover {
    background: var(--border);
}

.activity-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.activity-title:hover {
    background: rgba(65, 105, 225, 0.1);
}

.activity-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    min-height: 1.5rem;
}

.activity-description:hover {
    background: rgba(65, 105, 225, 0.05);
}

/* ==================== COSTS TABLE ==================== */
.costs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.costs-table thead {
    background: var(--primary);
    color: white;
}

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

.costs-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.costs-table tbody tr:hover {
    background: rgba(65, 105, 225, 0.02);
}

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

.costs-table td {
    padding: 0.4rem 0.75rem;
    vertical-align: middle;
}

.cost-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text);
}

.cost-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.cost-input.cost-activity {
    font-weight: 500;
}

.cost-input.cost-days,
.cost-input.cost-per-day {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.cost-total-cell {
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

.cost-total {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.costs-total-row {
    background: rgba(65, 105, 225, 0.05);
    border-top: 2px solid var(--primary);
}

.costs-total-row td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* ==================== DRAGGABLE TABLE ROWS ==================== */
.costs-table tbody tr.draggable-row {
    cursor: move;
    user-select: none;
}

.costs-table tbody tr.draggable-row:hover {
    background: rgba(65, 105, 225, 0.05);
}

.costs-table tbody tr.draggable-row.dragging {
    opacity: 0.5;
    background: rgba(65, 105, 225, 0.1);
    box-shadow: var(--shadow-lg);
}

.costs-table tbody tr.draggable-row.drag-over {
    border-top: 2px solid var(--primary);
    background: rgba(65, 105, 225, 0.08);
}

.drag-handle-cell {
    width: 40px;
    text-align: center;
    padding: 0.4rem 0.5rem !important;
    vertical-align: middle;
}

.drag-handle {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: grab;
    transition: var(--transition);
    user-select: none;
    line-height: 1;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.drag-handle:hover {
    color: var(--primary);
    background: rgba(65, 105, 225, 0.1);
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.costs-table tbody tr.draggable-row.dragging .drag-handle {
    color: var(--primary);
    opacity: 0.7;
}

/* ==================== CHATBOT PANEL ==================== */
.chatbot-tab {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 30px;
    height: 80px;
    background: var(--primary);
    border: none;
    cursor: pointer;
    box-shadow: -2px 0 10px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.chatbot-tab:hover {
    width: 35px;
    box-shadow: -4px 0 15px rgba(65, 105, 225, 0.4);
}

.chatbot-tab.open {
    right: 400px;
}

.chatbot-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--surface);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.chatbot-panel.open {
    right: 0;
}

.chatbot-header {
    padding: 1rem 1.5rem;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}

.chatbot-close:hover {
    opacity: 1;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--background);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-message.bot p {
    margin: 0 0 0.5rem 0;
}

.chat-message.bot p:last-child {
    margin-bottom: 0;
}

.chat-message.bot ul,
.chat-message.bot ol {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.chat-message.bot li {
    margin-bottom: 0.25rem;
}

.chat-message.bot strong {
    color: var(--primary);
}

.chatbot-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.chatbot-input-area input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.chatbot-input-area input:focus {
    outline: none;
    border-color: var(--primary);
}

.chatbot-input-area button {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.chatbot-input-area button:hover {
    background: var(--primary-dark);
}

.chatbot-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .chatbot-panel {
        width: 100%;
        right: -100%;
    }

    .chatbot-tab {
        height: 60px;
        width: 25px;
    }

    .chatbot-tab.open {
        right: 100%;
    }
}
/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin-overlay 1s linear infinite;
    margin-bottom: 1.5rem;
}

.loading-text {
    font-weight: 600;
    color: var(--text);
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

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