/**
 * Public CSS for WordPress Crypto Auto Trader
 *
 * @link       https://example.com/manus
 * @since      1.0.0
 * @package    WPCAT
 * @subpackage WPCAT/public/css
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.wpcat-frontend-dashboard,
.wpcat-frontend-trades-log {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Headers
   ========================================================================== */

.wpcat-dashboard-header,
.wpcat-trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.wpcat-dashboard-title,
.wpcat-trades-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpcat-icon {
    font-size: 32px;
}

.wpcat-header-actions {
    display: flex;
    gap: 12px;
}

.wpcat-refresh-btn,
.wpcat-export-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.wpcat-refresh-btn:hover,
.wpcat-export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.wpcat-refresh-icon,
.wpcat-export-icon {
    font-size: 16px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.wpcat-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.wpcat-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: wpcat-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes wpcat-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Stats Grid (Dashboard)
   ========================================================================== */

.wpcat-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wpcat-stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.wpcat-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.wpcat-stat-primary {
    border-left-color: #667eea;
}

.wpcat-stat-success {
    border-left-color: #28a745;
}

.wpcat-stat-danger {
    border-left-color: #dc3545;
}

.wpcat-stat-info {
    border-left-color: #17a2b8;
}

.wpcat-stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
}

.wpcat-stat-success .wpcat-stat-icon {
    background: rgba(40, 167, 69, 0.1);
}

.wpcat-stat-danger .wpcat-stat-icon {
    background: rgba(220, 53, 69, 0.1);
}

.wpcat-stat-info .wpcat-stat-icon {
    background: rgba(23, 162, 184, 0.1);
}

.wpcat-stat-content {
    flex: 1;
}

.wpcat-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1;
}

.wpcat-stat-label {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */

.wpcat-dashboard-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.wpcat-dashboard-col-6 {
    flex: 1;
}

.wpcat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.wpcat-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpcat-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.wpcat-card-body {
    padding: 24px;
}

.wpcat-view-all-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.wpcat-view-all-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Action Stats
   ========================================================================== */

.wpcat-action-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wpcat-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wpcat-action-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
}

.wpcat-action-icon {
    font-size: 18px;
}

.wpcat-action-icon.wpcat-buy {
    color: #28a745;
}

.wpcat-action-icon.wpcat-sell {
    color: #dc3545;
}

.wpcat-action-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

/* ==========================================================================
   Platform Stats
   ========================================================================== */

.wpcat-platform-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wpcat-platform-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wpcat-platform-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
}

.wpcat-platform-icon {
    font-size: 18px;
}

.wpcat-platform-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

/* ==========================================================================
   Filters Section
   ========================================================================== */

.wpcat-filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.wpcat-filters-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.wpcat-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.wpcat-filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.wpcat-filter-select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.wpcat-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wpcat-apply-filters-btn,
.wpcat-clear-filters-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.wpcat-apply-filters-btn {
    background: #28a745;
    color: white;
}

.wpcat-apply-filters-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.wpcat-clear-filters-btn {
    background: #6c757d;
    color: white;
    margin-right: 8px;
}

.wpcat-clear-filters-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* ==========================================================================
   Trades Table
   ========================================================================== */

.wpcat-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.wpcat-trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wpcat-trades-table th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: right;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.wpcat-trades-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.wpcat-trade-row:hover {
    background: #f8f9fa;
}

.wpcat-platform-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpcat-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 12px;
}

.wpcat-action-badge.wpcat-action-buy {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.wpcat-action-badge.wpcat-action-sell {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.wpcat-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 12px;
}

.wpcat-status-badge.wpcat-status-completed {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.wpcat-status-badge.wpcat-status-failed {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.wpcat-status-badge.wpcat-status-pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.wpcat-message-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.wpcat-pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.wpcat-pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.wpcat-pagination-list li {
    margin: 0;
}

.wpcat-pagination-list a {
    display: block;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wpcat-pagination-list a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.wpcat-pagination-list .wpcat-current-page a {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ==========================================================================
   Results Info
   ========================================================================== */

.wpcat-results-info {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin: 20px 0;
}

/* ==========================================================================
   Error States
   ========================================================================== */

.wpcat-error-message {
    background: white;
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #721c24;
}

.wpcat-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.wpcat-error-text h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.wpcat-error-text p {
    margin: 0 0 20px 0;
    color: #856404;
}

.wpcat-retry-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpcat-retry-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.wpcat-error {
    background: #f8d7da;
    color: #721c24;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 500;
}

/* ==========================================================================
   No Data State
   ========================================================================== */

.wpcat-no-data {
    background: white;
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    color: #6c757d;
}

.wpcat-no-data-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.wpcat-no-data h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
    color: #495057;
}

.wpcat-no-data p {
    margin: 0;
    font-size: 16px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .wpcat-frontend-dashboard,
    .wpcat-frontend-trades-log {
        padding: 15px;
    }
    
    .wpcat-dashboard-header,
    .wpcat-trades-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .wpcat-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .wpcat-dashboard-row {
        flex-direction: column;
    }
    
    .wpcat-filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wpcat-filter-group {
        min-width: auto;
    }
    
    .wpcat-table-container {
        overflow-x: auto;
    }
    
    .wpcat-trades-table {
        min-width: 800px;
    }
    
    .wpcat-pagination-list {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wpcat-dashboard-title,
    .wpcat-trades-title {
        font-size: 22px;
    }
    
    .wpcat-stat-card {
        padding: 16px;
    }
    
    .wpcat-stat-number {
        font-size: 24px;
    }
    
    .wpcat-card-body {
        padding: 16px;
    }
}

