/**
 * Site Tools & Utilities - Modern Enhanced Version
 * Form components, tables, and utility classes
 */

/* ============================================================
   MODERN SITE FORMS
   ============================================================ */
.site-form {
    display: grid;
    gap: 20px;
    margin: 28px 0;
}

.site-form label {
    display: grid;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main, #0f172a);
}

.site-form input,
.site-form select,
.site-form textarea {
    font: inherit;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-sm, 10px);
    width: 100%;
    min-width: 0;
    background: var(--bg-card, #ffffff);
    color: var(--text-main, #0f172a);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.site-form input:focus,
.site-form select:focus,
.site-form textarea:focus {
    outline: none;
    border-color: var(--primary, #24b2dd);
    box-shadow: 0 0 0 3px rgba(36, 178, 221, 0.1);
    transform: translateY(-1px);
}

.site-form input::placeholder,
.site-form textarea::placeholder {
    color: var(--text-muted, #94a3b8);
}

.site-form textarea {
    min-height: 120px;
    resize: vertical;
}

.site-form button,
.button {
    background: var(--primary-gradient, linear-gradient(135deg, #24b2dd 0%, #198cb0 100%));
    color: #ffffff;
    border: 0;
    border-radius: var(--radius-sm, 10px);
    padding: 12px 24px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(36, 178, 221, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.site-form button:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(36, 178, 221, 0.4);
}

.site-form button:active,
.button:active {
    transform: translateY(0);
}

.site-form button:disabled,
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Filter Form Layout */
.filter-form {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
}

@media (max-width: 768px) {
    .filter-form {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   COMMENTS SECTION - Enhanced
   ============================================================ */
.comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--border-color, #e2e8f0);
}

.comments-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-bottom: 24px;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    animation: fadeIn 0.5s ease-out;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author {
    font-weight: 700;
    color: var(--text-main, #0f172a);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

.comment p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.7;
    color: var(--text-secondary, #334155);
    font-size: 0.9rem;
}

.comments-section a {
    color: var(--primary, #24b2dd);
    text-decoration: none;
    transition: color 0.2s ease;
}

.comments-section a:hover {
    color: var(--primary-dark, #198cb0);
    text-decoration: underline;
}

.no-comments {
    padding: 32px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
    background: var(--bg-body, #f8fafc);
    border-radius: var(--radius-md, 14px);
    font-size: 0.9rem;
}

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

/* ============================================================
   RESPONSIVE TABLES
   ============================================================ */
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
    border-radius: var(--radius-md, 14px);
    border: 1px solid var(--border-color, #e2e8f0);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table thead {
    background: var(--bg-body, #f8fafc);
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    color: var(--text-secondary, #334155);
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}

table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background: var(--bg-card-hover, #f1f5f9);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive table on mobile */
@media (max-width: 768px) {
    table {
        font-size: 0.85rem;
    }
    
    table th,
    table td {
        padding: 10px 12px;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-sm, 10px); }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.04)); }
.shadow-md { box-shadow: var(--shadow-md, 0 4px 8px rgba(0, 0, 0, 0.08)); }
.shadow-lg { box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.12)); }

/* ============================================================
   SEARCH & FILTER COMPONENTS
   ============================================================ */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.04));
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--primary, #24b2dd);
    box-shadow: 0 0 0 3px rgba(36, 178, 221, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-main, #0f172a);
}

.search-input::placeholder {
    color: var(--text-muted, #94a3b8);
}

.search-button {
    padding: 8px 16px;
    background: var(--primary, #24b2dd);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm, 10px);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.search-button:hover {
    background: var(--primary-dark, #198cb0);
    transform: scale(1.05);
}

/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted, #94a3b8);
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color, #e2e8f0);
    border-top-color: var(--primary, #24b2dd);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .site-form button,
    .button,
    .search-bar,
    .filter-form {
        display: none !important;
    }
    
    .comments-section {
        page-break-before: always;
    }
    
    .table-responsive {
        overflow: visible;
        border: none;
    }
}
