/**
 * Telegram Scraper Pro - Styles
 * Version: 2.1
 */

/* ==========================================
   GENERAL STYLES
   ========================================== */

.telegram-scraper-interface,
.telegram-results-viewer {
    max-width: 1800px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tsp-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #0f2520 0%, #779f8e 100%);
    color: white;
    border-radius: 8px;
}

.tsp-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: white;
}

.tsp-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* ==========================================
   FORM STYLES
   ========================================== */

.tsp-config-panel {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tsp-form-group {
    margin-bottom: 20px;
}

.tsp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tsp-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.tsp-input {
    width: 100%;
    max-width: 500px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.tsp-input:focus {
    outline: none;
    border-color: #667eea;
}

.tsp-button {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
}

.tsp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tsp-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tsp-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tsp-button-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.tsp-button-warning {
    background: linear-gradient(135deg, #f09819 0%, #edde5d 100%);
    color: #333;
}

/* ==========================================
   PROGRESS PANEL
   ========================================== */

.tsp-progress-panel {
    background: #f0f7ff;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.tsp-progress-panel h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.tsp-progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.tsp-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    position: relative;
}

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

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

.tsp-progress-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.tsp-progress-stats {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ==========================================
   ERROR PANEL
   ========================================== */

.tsp-error-panel {
    background: #ffe5e5;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #dc3545;
}

.tsp-error-panel h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
}

#tsp-error-message {
    color: #721c24;
    font-size: 15px;
}

/* ==========================================
   CHANNEL INFO
   ========================================== */

.tsp-channel-info {
    background: linear-gradient(135deg, #0f2520 0%, #779f8e 100%);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: white;
}

.tsp-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.tsp-info-item {
    display: flex;
    flex-direction: column;
}

.tsp-info-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.tsp-info-value {
    font-size: 20px;
    font-weight: 700;
}

/* ==========================================
   CONTROLS
   ========================================== */

.tsp-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.tsp-filter-group {
    flex: 1;
    min-width: 250px;
}

.tsp-button-group {
    display: flex;
    gap: 10px;
}

/* ==========================================
   TABLE STYLES
   ========================================== */

.tsp-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#tsp-results-table {
    width: 100% !important;
}

#tsp-results-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: left;
    white-space: nowrap;
}

#tsp-results-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

#tsp-results-table tbody tr:hover {
    opacity: 0.8;
}

#tsp-results-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_length select {
    padding: 5px 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-left: 10px;
}

.dataTables_wrapper .dataTables_info {
    color: #666;
    font-size: 14px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 12px;
    margin: 0 2px;
    border: 2px solid #667eea !important;
    background: white !important;
    color: #667eea !important;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #667eea !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #667eea !important;
    color: white !important;
}

/* ==========================================
   MODAL
   ========================================== */

.tsp-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.tsp-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

.tsp-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.tsp-modal-close:hover,
.tsp-modal-close:focus {
    color: #000;
}

.tsp-detail-content {
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .tsp-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tsp-button-group {
        flex-direction: column;
    }

    .tsp-info-grid {
        grid-template-columns: 1fr;
    }

    .tsp-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}
