/* ==========================================================================
   Terms CSS — Style manage_spareparts
   Wymaga: jeremias-core.css
   ========================================================================== */

/* Welcome Section */
.welcome-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    text-align: center;
}

.welcome-section h1 {
    color: #004f9f;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.welcome-section p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

/* Info Panel */
.info-panel {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.info-title {
    color: #004f9f;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-title i { font-size: 1rem; }

.info-content {
    color: #374151;
    line-height: 1.6;
    font-size: 0.875rem;
}

.info-content p { margin: 0; }

/* Stats Cards — glass-morphism like spareparts */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #004f9f, #3b82f6);
    padding: 1.5rem;
    border-radius: 12px;
}

.stats-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s ease;
}

.stats-card::before { display: none; }

.stats-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.stats-card h3 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stats-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.stats-card .stats-details {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Terms Sections */
.terms-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.section-title {
    color: #004f9f;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 0.95rem;
    color: #004f9f;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Meta Information */
.meta-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
}

.meta-item i {
    color: #004f9f;
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
}

/* Terms Document Content */
.terms-document {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.terms-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #374151;
}

.terms-content h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #004f9f;
    margin: 2.5rem 0 1rem 0;
    padding: 0.75rem 0 0.75rem 1rem;
    border-left: 4px solid #004f9f;
    background: #f0f4ff;
    border-radius: 0 8px 8px 0;
}

.terms-content h1:first-child { margin-top: 0; }

.terms-content h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 2rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.terms-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.5rem 0 0.5rem 0;
}

.terms-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin: 1.25rem 0 0.5rem 0;
}

.terms-content h5, .terms-content h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin: 1rem 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.terms-content p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

.terms-content ul, .terms-content ol {
    margin: 0.5rem 0 1.25rem;
    padding-left: 1.75rem;
}

.terms-content ul { list-style-type: disc; }
.terms-content ol { list-style-type: decimal; }

.terms-content li {
    margin-bottom: 0.375rem;
    line-height: 1.7;
    color: #374151;
    padding-left: 0.25rem;
}

.terms-content li::marker { color: #004f9f; font-weight: 600; }
.terms-content ol li::marker { color: #004f9f; font-weight: 700; }

.terms-content li > ul, .terms-content li > ol {
    margin-top: 0.375rem;
    margin-bottom: 0.375rem;
}

.terms-content strong { color: #111827; font-weight: 700; }

.terms-content em { color: #4b5563; }

.terms-content a {
    color: #004f9f;
    text-decoration: underline;
    text-decoration-color: #c7d2fe;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease;
}

.terms-content a:hover {
    text-decoration-color: #004f9f;
}

.terms-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #004f9f;
    background: #f0f4ff;
    color: #374151;
    border-radius: 0 8px 8px 0;
}

.terms-content blockquote p {
    margin: 0;
    text-align: left;
    font-style: normal;
    font-weight: 500;
}

.terms-content blockquote strong {
    color: #004f9f;
}

.terms-content hr {
    margin: 2rem 0;
    border: none;
    border-top: 2px solid #e5e7eb;
}

.terms-content code {
    background: #f3f4f6;
    color: #374151;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    border: 1px solid #e5e7eb;
}

/* Tables in content */
.terms-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.875rem;
}

.terms-content th {
    background: #f9fafb;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.terms-content td {
    padding: 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    color: #374151;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: #004f9f;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.125rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 79, 159, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #3b82f6; transform: none; }

/* Print */
.print-version { display: none; }

@media print {
    .terms-section:not(.content-section), .header-actions,
    .back-to-top, .no-print, .info-panel, .stats-cards { display: none !important; }
    .print-version { display: block; text-align: center; margin-bottom: 2rem; font-size: 0.8rem; color: #6b7280; }
    .terms-document { box-shadow: none; border: none; padding: 0; }
    .terms-content { max-width: 100%; }
    .welcome-section { box-shadow: none; border: 1px solid #ccc; }
}

/* Responsive */
@media (max-width: 768px) {
    .terms-section { padding: 1rem; }
    .terms-document { padding: 1.5rem; }
    .header-actions { flex-direction: column; }
    .header-actions .btn { width: 100%; justify-content: center; }
    .meta-grid { grid-template-columns: 1fr; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); padding: 1rem; }
    .terms-content { font-size: 0.9rem; }
    .terms-content h1 { font-size: 1.25rem; }
    .terms-content h2 { font-size: 1.1rem; }
    .welcome-section { padding: 1.25rem; }
    .welcome-section h1 { font-size: 1.25rem; }
    .back-to-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; }
    .welcome-section .flex { flex-direction: column; gap: 0.75rem; }
}

@media (max-width: 480px) {
    .stats-cards { grid-template-columns: 1fr; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

*:focus-visible {
    outline: 2px solid #004f9f;
    outline-offset: 3px;
}
