/* B2Q Quote Styler - Modern UI Design */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --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;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Header Styles */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.bg-gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

header h1 {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header p {
    position: relative;
    z-index: 1;
    font-weight: 400;
    opacity: 0.9;
}

/* Card Enhancements */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-bottom: 1px solid var(--gray-200);
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem 1.5rem;
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 16px 16px 0 0;
}

.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Form Controls */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background-color: var(--gray-50);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: white;
    transform: translateY(-1px);
}

.form-control-color {
    width: 100%;
    height: 45px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-control-color:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.form-range {
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

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

/* Button Styles */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

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

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.btn-outline-secondary.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Preview Styles */
.preview-container {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.quote-preview {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    margin: 0 auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-preview:hover {
    box-shadow: var(--shadow-lg);
}

.mobile-preview .quote-preview {
    max-width: 320px;
}

.tablet-preview .quote-preview {
    max-width: 600px;
}

.quote-text {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 1rem;
    position: relative;
}

.quote-author {
    font-size: 0.9em;
    opacity: 0.8;
    text-align: right;
}

.quote-author strong {
    font-weight: 600;
    color: inherit;
}

.quote-author cite {
    font-style: italic;
    opacity: 0.9;
}

.page-number {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8em;
    opacity: 0.6;
}

/* Multi-Device Preview */
.preview-frame {
    background: var(--gray-100);
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.preview-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.preview-frame:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.mobile-frame {
    max-width: 200px;
    margin: 0 auto;
}

.tablet-frame {
    max-width: 280px;
    margin: 0 auto;
}

.desktop-frame {
    max-width: 100%;
}

.quote-preview-small {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.quote-text-small {
    margin-bottom: 0.5rem;
    font-style: italic;
}

.quote-author-small {
    font-size: 0.7em;
    opacity: 0.8;
    text-align: right;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 12px 12px 0 0;
    color: var(--gray-600);
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin-right: 4px;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: var(--shadow);
}

/* Radio Button Groups */
.btn-group .btn-check:checked + .btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    border-radius: 0 0 20px 20px;
    background: var(--gray-50);
    padding: 1.5rem;
}

/* Code Blocks */
pre {
    background: var(--gray-900);
    color: var(--gray-100);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

/* Sticky Positioning */
.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.75em;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

/* Toast Styles */
.toast {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .preview-container {
        padding: 1rem;
    }
    
    .quote-preview {
        padding: 1rem;
    }
    
    .sticky-top {
        position: static;
    }
}

@media (max-width: 576px) {
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .row.g-2 > * {
        padding: 0.25rem;
    }
    
    .btn-group .btn {
        padding: 0.5rem;
    }
    
    .preview-frame {
        padding: 0.5rem;
    }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-900: #f9fafb;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .btn, .nav-tabs {
        display: none;
    }
}