/* Scribigo Common Styles - Shared UI Components */

/* ===== GLOBAL RESET & BASE ===== */
.scribigo-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #1f2937;
    box-sizing: border-box;
}

.scribigo-container *,
.scribigo-container *::before,
.scribigo-container *::after {
    box-sizing: border-box;
}

/* ===== LAYOUT COMPONENTS ===== */
.scribigo-card {
background: white;
border: 2px solid #e5e7eb;
border-radius: 12px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 4px rgba(0, 0, 0, 0.05);
overflow: hidden;
transition: all 0.2s ease;
position: relative;
display: flex;
flex-direction: column;
height: 100%;
}

.scribigo-card:hover {
border-color: #3b82f6;
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scribigo-card-header {
padding: 1.5rem 2rem 1rem 2rem;
background: white;
border-bottom: 1px solid #e5e7eb;
font-size: 1.05rem;
font-weight: 600;
color: #1f2937;
}

.scribigo-card-body {
    padding: 2rem;
}

.scribigo-card-footer {
padding: 1.25rem 2rem 1.25rem 2rem;
background: #f8fafc;
border-top: 1px solid #e5e7eb;
border-radius: 0 0 10px 10px;
box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
}

/* ===== GRID SYSTEM ===== */
.scribigo-grid {
    display: grid;
    gap: 1.5rem;
}

.scribigo-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.scribigo-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.scribigo-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ===== FILTER BAR ===== */
.scribigo-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scribigo-filter-bar:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.scribigo-search {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.scribigo-search input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scribigo-search input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.scribigo-search .scribigo-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.9rem;
    pointer-events: none;
}

/* Filter Dropdown */
.scribigo-filter-dropdown {
    position: relative;
}

.scribigo-filter-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    color: #374151;
    white-space: nowrap;
    min-height: 44px;
}

.scribigo-filter-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
}

.scribigo-filter-btn i {
    margin-right: 8px;
    color: #3b82f6;
    font-size: 0.9rem;
}

.scribigo-dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
    top: 100%;
    right: 0;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
}

.scribigo-dropdown-content a {
    color: #374151;
    padding: 12px 16px;
    text-decoration: none !important;
    display: block;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.scribigo-dropdown-content a:hover {
    background: #f3f4f6;
    color: #1f2937;
    text-decoration: none !important;
}

.scribigo-filter-dropdown.open .scribigo-dropdown-content {
    display: block;
}

.scribigo-dropdown-content a.active {
    background: #3b82f6;
    color: white;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.scribigo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
    min-height: 44px;
}

.scribigo-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.scribigo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Variants */
.scribigo-btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.scribigo-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.scribigo-btn-secondary {
    background: white;
    color: #374151;
    border-color: #e5e7eb;
}

.scribigo-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.scribigo-btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.scribigo-btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.scribigo-btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.scribigo-btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

.scribigo-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: transparent;
}

.scribigo-btn-ghost:hover:not(:disabled) {
    background: #f3f4f6;
    color: #374151;
}

/* Button Sizes */
.scribigo-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 13px;
    min-height: 36px;
}

.scribigo-btn-lg {
    padding: 1rem 2rem;
    font-size: 16px;
    min-height: 52px;
}

/* ===== STATUS INDICATORS ===== */
.scribigo-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.scribigo-status-waiting {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.scribigo-status-processing {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.scribigo-status-completed {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #86efac;
}

.scribigo-status-failed {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.scribigo-status-unknown {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ===== PROGRESS BARS ===== */
.scribigo-progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.scribigo-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.scribigo-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== ZEICHENKONTINGENT-GAUGE (links voll, rechts leer) ===== */
.scribigo-quota-gauge {
    --fill-ratio: 0;
    display: block;
    width: 100%;
    height: 12px;
    line-height: 0;
}

.scribigo-quota-gauge--compact {
    display: inline-block;
    vertical-align: middle;
    width: 96px;
    height: 8px;
    flex: 0 0 auto;
}

.scribigo-quota-gauge__track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    border-radius: 999px;
    background: #d1d5db;
    overflow: hidden;
}

.scribigo-quota-gauge__fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: 100%;
    z-index: 1;
    background: #28a745;
    border-radius: inherit;
    transform-origin: 0% 50%;
    transform: scaleX(var(--fill-ratio, 0));
    transition: transform 0.35s ease;
}

.scribigo-quota-gauge__sections {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    pointer-events: none;
}

.scribigo-quota-gauge__sections > span {
    height: 100%;
    border-left: 1px solid rgba(15, 23, 42, 0.45);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.28);
}

.scribigo-quota-gauge__sections > span:first-child {
    border-left: none;
    box-shadow: none;
}

.scribigo-quota-gauge.is-warning .scribigo-quota-gauge__fill {
    background: #d4a72c;
}

.scribigo-quota-gauge.is-danger .scribigo-quota-gauge__fill {
    background: #dc3545;
}

.scribigo-quota-gauge--tariff {
    display: block;
    height: 10px;
    margin: 1.35rem 0 0.45rem;
}

/* ===== ALERTS & MESSAGES ===== */
.scribigo-alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.scribigo-alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.scribigo-alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.scribigo-alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.scribigo-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ===== FORM ELEMENTS ===== */
.scribigo-form-group {
    margin-bottom: 1.5rem;
}

.scribigo-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.scribigo-input,
.scribigo-textarea,
.scribigo-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scribigo-input:focus,
.scribigo-textarea:focus,
.scribigo-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== TABLES ===== */
.scribigo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.scribigo-table th,
.scribigo-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.scribigo-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

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

/* ===== LOADING STATES ===== */
.scribigo-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6b7280;
}

.scribigo-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
    .scribigo-grid-2,
    .scribigo-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .scribigo-card-body {
        padding: 1.5rem;
    }
    
    .scribigo-btn {
        width: 100%;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scribigo-fade-in-up {
    animation: fadeInUp 0.5s ease;
}

/* ===== COPY FUNCTIONALITY ===== */
.scribigo-copy-container {
    margin: 1rem 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.scribigo-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scribigo-copy-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.scribigo-copy-btn.success {
    background: #d1fae5;
    border-color: #86efac;
    color: #065f46;
}

/* ===== CONTENT FORMATTING ===== */
.scribigo-content {
    line-height: 1.7;
    color: #374151;
}

.scribigo-content h1,
.scribigo-content h2,
.scribigo-content h3,
.scribigo-content h4,
.scribigo-content h5,
.scribigo-content h6 {
    color: #1f2937;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.scribigo-content h1 { font-size: 1.875rem; }
.scribigo-content h2 { font-size: 1.5rem; }
.scribigo-content h3 { font-size: 1.25rem; }

.scribigo-content p {
    margin-bottom: 1em;
}

.scribigo-content ul,
.scribigo-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.scribigo-content blockquote {
    margin: 1.5em 0;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    border-radius: 0 6px 6px 0;
}

.scribigo-content code {
    background: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.875em;
}

.scribigo-content pre {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.scribigo-content pre code {
    background: none;
    padding: 0;
}

.scribigo-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.scribigo-content table th,
.scribigo-content table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.scribigo-content table th {
    background: #f8fafc;
    font-weight: 600;
}
