/* NOWPayments Crypto Widgets Styles */

/* Global Styles */
.npwc-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: #333;
}

.npwc-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.npwc-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: npwc-spin 1s linear infinite;
    z-index: 10;
}

@keyframes npwc-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.npwc-pro-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
}

.npwc-pro-notice a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.npwc-pro-notice a:hover {
    text-decoration: none;
}

/* Error and Loading States */
.npwc-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

.npwc-loading {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #bee5eb;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

/* Common Widget Elements */
.npwc-coin-icon {
    border-radius: 50%;
    vertical-align: middle;
}

.npwc-change {
    font-weight: 600;
    font-size: 0.9em;
}

.npwc-change.positive {
    color: #28a745;
}

.npwc-change.negative {
    color: #dc3545;
}

.npwc-change.positive::before {
    content: '+';
}

/* Ticker Specific Styles */
.npwc-crypto-ticker {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    background: #000;
    color: #fff;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#npwc-header-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#npwc-footer-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.npwc-ticker-container {
    height: 50px;
    display: flex;
    align-items: center;
}

.npwc-ticker-scroll {
    display: flex;
    align-items: center;
    gap: 30px;
    animation: npwc-scroll 60s linear infinite;
}

.npwc-ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes npwc-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Table Specific Styles */
.npwc-crypto-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.npwc-table-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.npwc-table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.npwc-live-indicator {
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    animation: npwc-pulse 2s infinite;
}

@keyframes npwc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.npwc-table-responsive {
    overflow-x: auto;
}

.npwc-price-table {
    width: 100%;
    border-collapse: collapse;
}

.npwc-price-table th {
    background: #f8f9fa;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.npwc-price-table th:hover {
    background: #e9ecef;
}

.npwc-price-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.npwc-coin-row {
    transition: background-color 0.2s ease;
}

.npwc-coin-row:hover {
    background: #f8f9fa;
}

.npwc-coin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.npwc-coin-details {
    display: flex;
    flex-direction: column;
}

.npwc-coin-name {
    font-weight: 600;
    margin: 0;
}

.npwc-coin-symbol {
    font-size: 0.85em;
    color: #6c757d;
    text-transform: uppercase;
}

.npwc-rank {
    color: #6c757d;
    font-weight: 500;
}

.npwc-price {
    font-weight: 600;
}

.npwc-mini-chart {
    cursor: pointer;
    border-radius: 4px;
}

.npwc-mini-chart:hover {
    background: rgba(0,0,0,0.05);
}

/* Pagination */
.npwc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.npwc-pagination button {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.npwc-pagination button:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.npwc-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.npwc-page-info {
    font-size: 14px;
    color: #6c757d;
}

/* Card Specific Styles */
.npwc-crypto-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    max-width: 350px;
    margin: 20px 0;
}

.npwc-crypto-card:hover,
.npwc-crypto-card.hovered {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.npwc-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.npwc-card-body {
    padding: 20px;
}

.npwc-price-section {
    text-align: center;
    margin-bottom: 20px;
}

.npwc-current-price {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.npwc-sparkline-section {
    text-align: center;
    margin-bottom: 20px;
}

.npwc-sparkline-chart {
    width: 100%;
    height: 60px;
    cursor: pointer;
    border-radius: 4px;
}

.npwc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.npwc-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.npwc-stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.npwc-stat-value {
    font-size: 14px;
    font-weight: 600;
}

.npwc-card-footer {
    background: #f8f9fa;
    padding: 12px 20px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.npwc-last-update {
    color: #6c757d;
    font-size: 11px;
}

/* Label Specific Styles */
.npwc-crypto-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    text-decoration: none;
}

.npwc-crypto-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    text-decoration: none;
    color: #495057;
}

.npwc-label-icon {
    width: 18px;
    height: 18px;
}

.npwc-label-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Chart Specific Styles (Pro) */
.npwc-crypto-chart {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
}

.npwc-chart-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.npwc-chart-controls {
    display: flex;
    gap: 10px;
}

.npwc-chart-control {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.npwc-chart-control:hover,
.npwc-chart-control.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.npwc-chart-container {
    padding: 20px;
    height: 400px;
}

/* Converter Specific Styles (Pro) */
.npwc-crypto-converter {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
    max-width: 400px;
}

.npwc-converter-header {
    text-align: center;
    margin-bottom: 20px;
}

.npwc-converter-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.npwc-converter-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.npwc-converter-input label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
}

.npwc-converter-input input,
.npwc-converter-input select {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.npwc-converter-swap {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.npwc-converter-swap:hover {
    background: #5a6fd8;
    transform: rotate(180deg);
}

.npwc-convert-btn {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.npwc-convert-btn:hover {
    background: #218838;
}

/* News Widget Styles (Pro) */
.npwc-crypto-news {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
}

.npwc-news-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
}

.npwc-news-item {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.npwc-news-item:hover {
    background: #f8f9fa;
}

.npwc-news-item:last-child {
    border-bottom: none;
}

.npwc-news-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #212529;
}

.npwc-news-excerpt {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.npwc-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #adb5bd;
}

.npwc-news-source {
    font-weight: 500;
}

/* Theme Variations */

/* Dark Theme */
.npwc-dark {
    background: #1a1a1a;
    color: #ffffff;
}

.npwc-dark .npwc-price-table {
    background: #1a1a1a;
    color: #ffffff;
}

.npwc-dark .npwc-price-table th {
    background: #2d2d2d;
    color: #ffffff;
    border-color: #404040;
}

.npwc-dark .npwc-price-table td {
    border-color: #404040;
}

.npwc-dark .npwc-coin-row:hover {
    background: #2d2d2d;
}

.npwc-dark .npwc-crypto-card {
    background: #1a1a1a;
    color: #ffffff;
}

.npwc-dark .npwc-card-footer {
    background: #2d2d2d;
    border-color: #404040;
}

.npwc-dark .npwc-crypto-label {
    background: #343a40;
    border-color: #495057;
    color: #f8f9fa;
}

.npwc-dark .npwc-crypto-label:hover {
    background: #495057;
    border-color: #6c757d;
}

/* Light Theme (explicitly defined) */
.npwc-light {
    background: #ffffff;
    color: #333333;
}

/* Gloss Theme */
.npwc-gloss {
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .npwc-crypto-card {
        max-width: 100%;
    }
    
    .npwc-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .npwc-stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .npwc-price-table th,
    .npwc-price-table td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .npwc-coin-icon {
        width: 24px;
        height: 24px;
    }
    
    .npwc-table-header {
        padding: 10px 15px;
    }
    
    .npwc-table-header h3 {
        font-size: 16px;
    }
    
    .npwc-ticker-item {
        gap: 6px;
    }
    
    .npwc-ticker-item .npwc-coin-icon {
        width: 16px;
        height: 16px;
    }
    
    .npwc-ticker-item span {
        font-size: 12px;
    }
    
    .npwc-converter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .npwc-converter-swap {
        align-self: center;
        transform: rotate(90deg);
    }
    
    .npwc-converter-swap:hover {
        transform: rotate(270deg);
    }
}

@media (max-width: 480px) {
    .npwc-crypto-card {
        margin: 10px 0;
    }
    
    .npwc-card-header {
        padding: 15px;
    }
    
    .npwc-card-body {
        padding: 15px;
    }
    
    .npwc-current-price {
        font-size: 24px;
    }
    
    .npwc-table-responsive {
        font-size: 11px;
    }
    
    .npwc-pagination {
        padding: 10px 15px;
    }
    
    .npwc-pagination button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .npwc-crypto-ticker,
    .npwc-pagination,
    .npwc-converter-row,
    .npwc-chart-controls {
        display: none;
    }
    
    .npwc-crypto-card,
    .npwc-crypto-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .npwc-card-header,
    .npwc-table-header {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .npwc-ticker-scroll {
        animation: none;
    }
    
    .npwc-crypto-card {
        transition: none;
    }
    
    .npwc-live-indicator {
        animation: none;
    }
    
    .npwc-spinner {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .npwc-crypto-table {
        border: 2px solid #000;
    }
    
    .npwc-price-table th {
        border-bottom: 2px solid #000;
    }
    
    .npwc-price-table td {
        border-bottom: 1px solid #000;
    }
    
    .npwc-crypto-card {
        border: 2px solid #000;
    }
    
    .npwc-crypto-label {
        border: 2px solid #000;
    }
}
