/**
 * Frontend Styles for BigQuery Data Viewer Plugin
 * 
 * @package BigQuery_Data_Viewer
 * @since 1.0.0
 */

/* ============================================
   Container & Layout
   ============================================ */

.bqv-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   Filter Form
   ============================================ */

.bqv-filters {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.bqv-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

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

.bqv-filters select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out;
}

.bqv-filters select:hover {
    border-color: #80bdff;
}

.bqv-filters select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.bqv-filters button[type="submit"] {
    padding: 8px 24px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    align-self: flex-end;
}

.bqv-filters button[type="submit"]:hover {
    background-color: #0056b3;
}

.bqv-filters button[type="submit"]:active {
    background-color: #004085;
}

/* ============================================
   Cards Container
   ============================================ */

.bqv-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Individual Card
   ============================================ */

.bigquery-card {
    display: flex;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.bigquery-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   Voting Section (Left Side)
   ============================================ */

.card-voting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-right: 16px;
    min-width: 60px;
}

.vote-arrow {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-in-out;
    color: #6c757d;
}

.vote-arrow svg {
    width: 24px;
    height: 24px;
}

.vote-arrow:hover {
    transform: scale(1.2);
}

.vote-arrow.vote-up:hover {
    color: #28a745;
}

.vote-arrow.vote-down:hover {
    color: #dc3545;
}

.vote-arrow:active {
    transform: scale(0.95);
}

.vote-arrow:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.vote-count {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    min-width: 40px;
    user-select: none;
}

/* ============================================
   Card Content (Right Side)
   ============================================ */

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-brand {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #212529;
}

.card-number {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #007bff;
}

.card-explanation {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
}

.card-source {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease-in-out;
}

.card-source:hover {
    color: #0056b3;
    text-decoration: underline;
}

.card-update-date {
    color: #6c757d;
}

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

.bqv-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.bqv-pagination a,
.bqv-pagination span {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    font-size: 14px;
}

.bqv-pagination a:hover {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.bqv-pagination .current {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: 600;
}

.bqv-pagination .dots {
    border: none;
    cursor: default;
}

.bqv-pagination .dots:hover {
    background-color: transparent;
    color: #6c757d;
}

/* ============================================
   Loading & Error States
   ============================================ */

.bqv-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.bqv-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    padding: 16px;
    margin-bottom: 20px;
}

.bqv-no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 8px;
}

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

@media (max-width: 768px) {
    .bqv-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bqv-filter-group {
        min-width: 100%;
    }
    
    .bqv-filters button[type="submit"] {
        align-self: stretch;
        margin-top: 10px;
    }
    
    .bigquery-card {
        flex-direction: column;
    }
    
    .card-voting {
        flex-direction: row;
        justify-content: center;
        margin-right: 0;
        margin-bottom: 12px;
        width: 100%;
    }
    
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .bqv-container {
        padding: 10px;
    }
    
    .bqv-filters {
        padding: 15px;
    }
    
    .bigquery-card {
        padding: 12px;
    }
    
    .card-brand {
        font-size: 16px;
    }
    
    .card-number {
        font-size: 20px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .bqv-filters,
    .card-voting,
    .bqv-pagination {
        display: none;
    }
    
    .bigquery-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

