/* Terms and Conditions Generator Styles */

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* Tab Navigation */
.tab-button {
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #4f46e5;
}

.tab-button.active {
    color: #4f46e5 !important;
    border-bottom-color: #4f46e5 !important;
}

/* Form Enhancements */
#termsForm input:focus,
#termsForm select:focus,
#termsForm textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#termsForm input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
    accent-color: #4f46e5;
}

#termsForm input[type="checkbox"]:checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

/* Business Type Conditional Display */
.business-type-section {
    transition: all 0.3s ease;
    overflow: hidden;
}

.business-type-section.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Document Content Styling */
#documentContent {
    font-family: "Georgia", serif;
    line-height: 1.7;
    color: #374151;
}

#documentContent h1 {
    color: #1f2937;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

#documentContent h2 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-left: 0.5rem;
    border-left: 4px solid #4f46e5;
}

#documentContent h3 {
    color: #4b5563;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

#documentContent p {
    margin-bottom: 1rem;
    text-align: justify;
}

#documentContent ul,
#documentContent ol {
    margin: 1rem 0 1rem 2rem;
}

#documentContent li {
    margin-bottom: 0.5rem;
}

#documentContent strong {
    font-weight: 600;
    color: #1f2937;
}

#documentContent em {
    font-style: italic;
    color: #6b7280;
}

/* Validation Results Styling */
.validation-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
}

.validation-item.success {
    background-color: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.validation-item.warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.validation-item.error {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.validation-item.info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.validation-item .title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

.validation-item .title svg {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.validation-item .description {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Metadata Display */
.metadata-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.metadata-section h4 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.metadata-item .label {
    font-size: 0.875rem;
    color: #6b7280;
}

.metadata-item .value {
    font-weight: 600;
    color: #374151;
}

/* Export Button States */
.export-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.export-btn:active {
    transform: translateY(0);
}

.export-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Document Statistics */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-card .value {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-card .label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Message Styling */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.message.success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.message.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.message.warning {
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    color: #92400e;
}

.message.info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.message svg {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.message .content {
    flex: 1;
}

.message .title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.message .description {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Legal Compliance Indicators */
.compliance-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.25rem;
}

.compliance-badge.compliant {
    background-color: #dcfce7;
    color: #166534;
}

.compliance-badge.partial {
    background-color: #fef3c7;
    color: #92400e;
}

.compliance-badge.non-compliant {
    background-color: #fee2e2;
    color: #dc2626;
}

.compliance-badge svg {
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
}

/* Recommendation Cards */
.recommendation {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.recommendation.priority-high {
    border-left: 4px solid #ef4444;
}

.recommendation.priority-medium {
    border-left: 4px solid #f59e0b;
}

.recommendation.priority-low {
    border-left: 4px solid #10b981;
}

.recommendation .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.recommendation .title {
    font-weight: 600;
    color: #374151;
}

.recommendation .priority {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.recommendation .priority.high {
    background-color: #fee2e2;
    color: #dc2626;
}

.recommendation .priority.medium {
    background-color: #fef3c7;
    color: #92400e;
}

.recommendation .priority.low {
    background-color: #dcfce7;
    color: #166534;
}

.recommendation .description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .grid.grid-cols-1.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .sticky {
        position: static;
    }

    .tab-button {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    #documentContent {
        padding: 1rem;
        max-height: none;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    #documentContent {
        max-height: none;
        overflow: visible;
        background: white !important;
        padding: 0;
        border: none;
    }

    .tab-content:not(#documentTab) {
        display: none !important;
    }

    body {
        background: white !important;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
button:focus,
select:focus,
input:focus,
textarea:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Custom Scrollbar */
#documentContent::-webkit-scrollbar {
    width: 8px;
}

#documentContent::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#documentContent::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#documentContent::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
