/* MTG Price Checker Web Application - Custom Styles */

/* Root variables for theming */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --muted-color: #6c757d;
}

/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Header styles */
h1 {
    color: var(--dark-color);
    font-weight: 600;
}

/* Card styles */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Form styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#cardNames {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 200px;
}

/* Store selection styles */
#storeSelection {
    background-color: #ffffff;
    min-height: 120px;
}

.form-check {
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.form-check:hover {
    background-color: #f8f9fa;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.store-checkbox {
    margin-top: 6px;
}

/* Button styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Loading and state styles */
.spinner-border {
    animation: spin 1s linear infinite;
}

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

#loadingState .card-body {
    padding: 3rem 2rem;
}

#welcomeState .card-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Table styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--dark-color);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

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

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table td {
    vertical-align: middle;
    padding: 0.875rem 0.75rem;
    border-color: #f1f3f4;
}

/* Badge styles */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.25px;
}

.badge.bg-success {
    background-color: var(--success-color) !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-secondary {
    background-color: var(--muted-color) !important;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length select {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 4px 8px;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 6px 12px;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.875rem;
    color: var(--muted-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--light-color) !important;
    border-color: #dee2e6 !important;
}

/* Summary styles */
#summaryContent h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

#summaryContent .text-center {
    padding: 1rem 0.5rem;
}

#summaryContent .border {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Alert styles */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Footer styles */
footer {
    margin-top: auto;
    background-color: var(--light-color) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .table thead th {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }
    
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    #summaryContent .text-center {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    #cardNames {
        min-height: 150px;
    }
    
    .btn {
        font-size: 0.875rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
}

/* Print styles */
@media print {
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .btn, footer, #priceCheckForm {
        display: none !important;
    }
    
    body {
        background-color: white !important;
    }
}

/* Custom utility classes */
.text-price {
    font-weight: 600;
    color: var(--success-color);
}

.text-unavailable {
    color: var(--muted-color);
    font-style: italic;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Loading animation for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .table thead th {
        border: 1px solid var(--dark-color);
    }
    
    .btn-outline-secondary {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
