/* ========================================
   TERMS AND POLICIES MANAGEMENT STYLES
   ======================================== */

/* Active Documents Section */
.terms-active-section {
    margin-bottom: 40px;
}

.terms-active-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.terms-active-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.terms-active-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.terms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.terms-card-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-card-header h4 i {
    color: #3b82f6;
}

.terms-card-body {
    padding: 24px;
}

.terms-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.terms-empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.terms-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Document Info */
.terms-doc-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.terms-doc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.terms-doc-row:last-child {
    border-bottom: none;
}

.terms-doc-label {
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terms-doc-value {
    color: #1e293b;
    font-weight: 500;
}

.terms-doc-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.terms-doc-actions button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.terms-doc-actions .btn-view {
    background: #f1f5f9;
    color: #475569;
}

.terms-doc-actions .btn-view:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.terms-doc-actions .btn-stats {
    background: #dbeafe;
    color: #1e40af;
}

.terms-doc-actions .btn-stats:hover {
    background: #bfdbfe;
    color: #1e3a8a;
}

/* Badges */
.terms-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terms-badge-terms {
    background: #dbeafe;
    color: #1e40af;
}

.terms-badge-privacy {
    background: #fce7f3;
    color: #9f1239;
}

.terms-status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terms-status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.terms-status-badge.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.terms-version-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* History Section */
.terms-history-section {
    margin-top: 40px;
}

.terms-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.terms-filters select {
    flex: 1;
    max-width: 250px;
}

/* Table Styles */
.terms-table-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.terms-table-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.terms-table-actions .btn-view {
    background: #f1f5f9;
    color: #475569;
}

.terms-table-actions .btn-view:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.terms-table-actions .btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.terms-table-actions .btn-edit:hover {
    background: #bfdbfe;
    color: #1e3a8a;
}

.terms-table-actions .btn-stats {
    background: #fef3c7;
    color: #92400e;
}

.terms-table-actions .btn-stats:hover {
    background: #fde68a;
    color: #78350f;
}

.terms-table-actions .btn-activate {
    background: #dcfce7;
    color: #166534;
}

.terms-table-actions .btn-activate:hover {
    background: #bbf7d0;
    color: #14532d;
}

.terms-table-actions .btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.terms-table-actions .btn-delete:hover {
    background: #fecaca;
    color: #7f1d1d;
}

.terms-table-actions .btn-activate:disabled,
.terms-table-actions .btn-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
#terms-modal .modal-content,
#terms-view-modal .modal-content,
#terms-stats-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#terms-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    min-height: 300px;
}

.terms-view-info {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 24px;
}

.terms-view-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.terms-view-dates {
    display: flex;
    gap: 20px;
    color: #64748b;
    font-size: 13px;
}

.terms-view-dates i {
    margin-right: 6px;
    color: #94a3b8;
}

.terms-view-content {
    padding: 24px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.8;
    color: #1e293b;
}

.terms-view-content h1,
.terms-view-content h2,
.terms-view-content h3 {
    color: #1e293b;
    margin-top: 24px;
    margin-bottom: 12px;
}

.terms-view-content h1 {
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.terms-view-content h2 {
    font-size: 20px;
}

.terms-view-content h3 {
    font-size: 16px;
}

.terms-view-content p {
    margin-bottom: 16px;
}

.terms-view-content ul,
.terms-view-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.terms-view-content li {
    margin-bottom: 8px;
}

/* Stats Modal */
.terms-stats-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.terms-stats-header h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #1e293b;
}

.terms-stats-meta {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Delete Confirmation */
.delete-confirmation {
    text-align: center;
    padding: 20px;
}

.warning-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-icon i {
    font-size: 40px;
    color: #ef4444;
}

.delete-confirmation h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 18px;
}

.delete-confirmation p {
    color: #64748b;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .terms-active-grid {
        grid-template-columns: 1fr;
    }
    
    .terms-filters {
        flex-direction: column;
    }
    
    .terms-filters select {
        max-width: 100%;
    }
    
    .terms-table-actions {
        flex-wrap: wrap;
    }
    
    .terms-doc-actions {
        flex-direction: column;
    }
}

