/* BidSistant - Modern Application Styles */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors - Blue/Purple gradient theme */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-900: #1e3a8a;

    /* Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status Colors */
    --success-light: #d1fae5;
    --success-dark: #065f46;
    --warning-light: #fed7aa;
    --warning-dark: #9a3412;
    --error-light: #fee2e2;
    --error-dark: #991b1b;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-subtle: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

/* Base markdown preview styles with modern touch */
.markdown-preview {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--gray-800);
}

.markdown-preview h1 {
    font-size: 2.25em;
    font-weight: 700;
    margin-bottom: 0.75em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 0.4em;
    border-bottom: 3px solid var(--primary-200);
}

.markdown-preview h2 {
    font-size: 1.75em;
    font-weight: 600;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    color: var(--gray-900);
    position: relative;
    padding-left: 1rem;
}

.markdown-preview h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25em;
    bottom: 0.25em;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.markdown-preview p {
    margin-bottom: 1.25em;
    font-size: 1.05em;
}

.markdown-preview ul,
.markdown-preview ol {
    margin-left: 2em;
    margin-bottom: 1.25em;
}

.markdown-preview li {
    margin-bottom: 0.625em;
    line-height: 1.6;
}

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

/* HTMX indicators with smooth animations */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

/* Modern loading spinner with gradient */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-radius: 50%;
    border-top-color: var(--primary-500);
    border-right-color: var(--accent-purple);
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

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

/* Enhanced pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth ping with gradient */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    background: var(--gradient-primary);
}

/* Modern card with glass morphism */
.proposal-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.proposal-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.proposal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.proposal-card:hover::before {
    opacity: 1;
}

/* Beautiful gradient buttons */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Modern secondary button */
.btn-secondary {
    background-color: white;
    border: 2px solid var(--gray-200);
    padding: 0.625rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Modern badge styles with gradients */
.badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.badge-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-green {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: var(--gray-900);
}

.badge-orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.badge-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: var(--gray-900);
}

/* Enhanced form styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 1rem;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9375rem;
}

/* Modern tab navigation */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.tab-button {
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.tab-button.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
    background: var(--primary-50);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

/* Version history with modern styling */
.version-item {
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 1rem;
}

.version-item:hover {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 25%, transparent 25%);
    transform: translateX(4px);
}

.version-item.current {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
}

/* Enhanced diff view */
.diff-view {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    border-radius: 8px;
    overflow: hidden;
}

.diff-addition {
    background: linear-gradient(90deg, #d1fae5 0%, #a7f3d0 100%);
    color: var(--success-dark);
    padding: 0.25rem 0.5rem;
    border-left: 4px solid #10b981;
}

.diff-deletion {
    background: linear-gradient(90deg, #fee2e2 0%, #fecaca 100%);
    color: var(--error-dark);
    padding: 0.25rem 0.5rem;
    border-left: 4px solid #ef4444;
}

.diff-change {
    background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    color: var(--warning-dark);
    padding: 0.25rem 0.5rem;
    border-left: 4px solid #f59e0b;
}

/* Success/Error messages with modern styling */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
    color: var(--success-dark);
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
    color: var(--error-dark);
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
    color: var(--primary-900);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .markdown-preview h1 {
        font-size: 1.875em;
    }

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

    .btn-primary, .btn-secondary {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }

    .tab-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .markdown-preview {
        font-size: 12pt;
    }

    .btn-primary, .btn-secondary {
        box-shadow: none !important;
    }
}

/* Scrollbar styling for modern browsers */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
    border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Selection styling */
::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

::-moz-selection {
    background: var(--primary-200);
    color: var(--primary-900);
}
