/**
 * WP Crypto Live Market Module Styles
 * 
 * Table of Contents:
 * 1. Base Layout & Reset
 * 2. Header Info Component
 * 3. Admin Content Sections
 * 4. Pages Grid & Cards
 * 5. Form Controls & Inputs
 * 6. Button Styles
 * 7. Coin Management
 * 8. Popular Coins Section
 * 9. Frontend Widget
 * 10. Widget Table Layout
 * 11. Mobile Card Layout
 * 12. Loading States & Animations
 * 13. Status Indicators
 * 14. Mobile Responsive Design
 */

.wrap,
.wrap * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wrap {
    width: 100%;
    padding: 20px;
    margin: 20px auto;
    max-width: calc(100vw - 200px);
}

.folded .wrap {
    max-width: calc(100vw - 160px);
}

@media (max-width: 1200px) {
    .wrap {
        max-width: calc(100vw - 120px);
    }

    .folded .wrap {
        max-width: calc(100vw - 100px);
    }
}

@media (max-width: 960px) {
    .wrap {
        max-width: calc(100vw - 80px);
    }

    .folded .wrap {
        max-width: calc(100vw - 60px);
    }
}

@media (max-width: 768px) {
    .wrap {
        max-width: calc(100vw - 40px);
        margin: 15px auto;
        padding: 15px;
    }

    .folded .wrap {
        max-width: calc(100vw - 30px);
    }
}

@media (max-width: 600px) {
    .wrap {
        max-width: calc(100vw - 20px);
        margin: 10px auto;
        padding: 12px;
    }

    .folded .wrap {
        max-width: calc(100vw - 15px);
    }
}

@media (max-width: 480px) {
    .wrap {
        max-width: calc(100vw - 10px);
        margin: 5px auto;
        padding: 10px;
    }

    .folded .wrap {
        max-width: calc(100vw - 5px);
    }
}

.wpcrypto-header-info {
    background: linear-gradient(135deg, #1e3c72, #667eea);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wpcrypto-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 45px;
    margin-bottom: 15px;
    gap: 15px;
}

.wpcrypto-header-left {
    flex: 0 0 auto;
    margin-right: auto;
}

.wpcrypto-header-center {
    flex: 0 0 auto;
}

.wpcrypto-header-logo {
    height: 32px;
    width: auto;
}

.wpcrypto-header-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wpcrypto-header-right {
    display: flex;
    gap: 8px;
}

.wpcrypto-header-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.wpcrypto-header-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.wpcrypto-header-action-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-color: #8b5cf6;
}

.wpcrypto-header-action-btn.primary:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    border-color: #7c3aed;
}

.wpcrypto-header-info hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 15px 0;
}

.wpcrypto-info-content {
    line-height: 1.6;
}

.wpcrypto-info-content p {
    margin-bottom: 15px;
}

.wpcrypto-info-content p:last-child {
    margin-bottom: 0;
}

.wpcrypto-admin-content,
.wpcrypto-empty-state-section,
.wpcrypto-form-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.wpcrypto-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #64748b;
}

.wpcrypto-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.wpcrypto-empty-state h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1e293b;
    font-weight: 600;
}

.wpcrypto-empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.wpcrypto-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.wpcrypto-page-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpcrypto-page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: #6366f1;
}

.wpcrypto-page-header {
    background: #f8fafc;
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.wpcrypto-crypto-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-right: 16px;
}

.wpcrypto-page-info h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #1e293b;
    font-weight: 600;
}

.wpcrypto-crypto-name {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.wpcrypto-page-stats {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
}

.wpcrypto-stat {
    text-align: center;
}

.wpcrypto-stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.wpcrypto-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #6366f1;
}

.wpcrypto-shortcode {
    padding: 16px 20px;
    background: #1e293b;
    color: white;
}

.wpcrypto-shortcode label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.wpcrypto-shortcode input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.wpcrypto-page-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.wpcrypto-btn {
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.wpcrypto-btn-primary {
    background: #2563eb;
    color: white;
}

.wpcrypto-btn-primary:hover {
    background: #1d4ed8;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.wpcrypto-btn-secondary {
    background: #64748b;
    color: white;
}

.wpcrypto-btn-secondary:hover {
    background: #475569;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.wpcrypto-btn-danger {
    background: #dc2626;
    color: white;
}

.wpcrypto-btn-danger:hover {
    background: #b91c1c;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.wpcrypto-btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.wpcrypto-form-section h2 {
    background: #f8fafc;
    margin: -20px -20px 20px -20px;
    padding: 15px 20px;
    font-size: 18px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.wpcrypto-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.wpcrypto-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.wpcrypto-form-group input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.wpcrypto-form-group input[type="text"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wpcrypto-form-group small {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.wpcrypto-live-market-coins-container {
    margin-bottom: 20px;
}

.wpcrypto-live-market-coin-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-coin-row:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.wpcrypto-live-market-coin-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpcrypto-live-market-coin-icon img {
    width: 28px;
    height: 28px;
    object-fit: cover;
}

.wpcrypto-live-market-coin-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    background: white;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-coin-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wpcrypto-live-market-remove-coin {
    background: #ef4444;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-remove-coin:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.wpcrypto-live-market-add-section {
    margin: 20px 0;
    text-align: center;
}

.wpcrypto-live-market-add-section .button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #10b981;
    border-color: #10b981;
    color: white;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-add-section .button:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-2px);
}

.wpcrypto-live-market-popular-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    margin-top: 20px;
}

.wpcrypto-live-market-popular-section h3 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.wpcrypto-live-market-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.wpcrypto-live-market-popular-coin {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-popular-coin:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
    transform: translateY(-2px);
}

.wpcrypto-live-market-popular-coin img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.wpcrypto-live-market-popular-coin-info {
    display: flex;
    flex-direction: column;
}

.wpcrypto-live-market-popular-coin-symbol {
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
}

.wpcrypto-live-market-popular-coin-name {
    font-size: 11px;
    opacity: 0.7;
    line-height: 1;
    margin-top: 2px;
}

.wpcrypto-form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 20px 0 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

.wpcrypto-live-market-widget {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.wpcrypto-live-market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
}

.wpcrypto-live-market-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wpcrypto-live-market-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.wpcrypto-live-market-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: wpcrypto-live-market-pulse 2s infinite;
}

.wpcrypto-live-market-loading {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.wpcrypto-live-market-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: wpcrypto-live-market-spin 1s linear infinite;
    margin: 0 auto 16px;
}

.wpcrypto-live-market-table-container {
    overflow-x: auto;
    background: white;
}

.wpcrypto-live-market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.wpcrypto-live-market-table thead {
    background: #f8fafc;
}

.wpcrypto-live-market-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpcrypto-live-market-th-coin {
    min-width: 160px;
}

.wpcrypto-live-market-th-price {
    text-align: right;
    min-width: 100px;
}

.wpcrypto-live-market-th-change {
    text-align: center;
    min-width: 100px;
}

.wpcrypto-live-market-th-high,
.wpcrypto-live-market-th-low {
    text-align: right;
    min-width: 100px;
}

.wpcrypto-live-market-th-volume {
    text-align: right;
    min-width: 120px;
}

.wpcrypto-live-market-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-table tbody tr:hover {
    background: #f8fafc;
}

.wpcrypto-live-market-table td {
    padding: 12px 10px;
    vertical-align: middle;
}

.wpcrypto-live-market-coin-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpcrypto-live-market-coin-icon-cell {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpcrypto-live-market-coin-icon-cell img {
    width: 28px;
    height: 28px;
    object-fit: cover;
}

.wpcrypto-live-market-coin-info {
    min-width: 0;
}

.wpcrypto-live-market-coin-symbol {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.2;
}

.wpcrypto-live-market-coin-name {
    font-size: 12px;
    color: #64748b;
    line-height: 1.2;
    margin-top: 2px;
}

.wpcrypto-live-market-price-cell {
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.3s ease;
}

.wpcrypto-live-market-price-cell.wpcrypto-live-market-price-up {
    animation: wpcrypto-live-market-flash-green 0.6s ease;
}

.wpcrypto-live-market-price-cell.wpcrypto-live-market-price-down {
    animation: wpcrypto-live-market-flash-red 0.6s ease;
}

.wpcrypto-live-market-change-cell {
    text-align: center;
}

.wpcrypto-live-market-change-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    min-width: 70px;
    justify-content: center;
}

.wpcrypto-live-market-change-badge.positive {
    background: #dcfce7;
    color: #166534;
}

.wpcrypto-live-market-change-badge.negative {
    background: #fef2f2;
    color: #991b1b;
}

.wpcrypto-live-market-change-badge.positive::before {
    content: '▲';
    font-size: 9px;
}

.wpcrypto-live-market-change-badge.negative::before {
    content: '▼';
    font-size: 9px;
}

.wpcrypto-live-market-high-cell,
.wpcrypto-live-market-low-cell,
.wpcrypto-live-market-volume-cell {
    text-align: right;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.wpcrypto-live-market-high-cell {
    color: #059669;
}

.wpcrypto-live-market-low-cell {
    color: #dc2626;
}

.wpcrypto-live-market-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.wpcrypto-live-market-retry {
    background: #6366f1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.wpcrypto-live-market-retry:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.wpcrypto-mobile-market-list {
    display: none;
}

.wpcrypto-mobile-market-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpcrypto-mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.wpcrypto-mobile-card-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.wpcrypto-mobile-card-label {
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    flex-shrink: 0;
}

.wpcrypto-mobile-card-content {
    flex: 1;
    margin-left: 10px;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.4;
}

@keyframes wpcrypto-live-market-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes wpcrypto-live-market-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes wpcrypto-live-market-flash-green {
    0% {
        background: rgba(16, 185, 129, 0.2);
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

@keyframes wpcrypto-live-market-flash-red {
    0% {
        background: rgba(239, 68, 68, 0.2);
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .wpcrypto-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .wpcrypto-header-left {
        margin-right: 0;
    }

    .wpcrypto-header-title {
        font-size: 18px;
    }

    .wpcrypto-pages-grid {
        grid-template-columns: 1fr;
    }

    .wpcrypto-live-market-popular-grid {
        grid-template-columns: 1fr;
    }

    .wpcrypto-live-market-coin-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .wpcrypto-live-market-coin-input {
        min-width: 200px;
    }

    .wpcrypto-page-actions {
        flex-direction: column;
    }

    .wpcrypto-form-actions {
        flex-direction: column;
        align-items: center;
    }

    .wpcrypto-live-market-table-container {
        display: none;
    }

    .wpcrypto-mobile-market-list {
        display: block;
    }

    .wpcrypto-live-market-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 15px;
    }

    .wpcrypto-live-market-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .wpcrypto-header-title {
        font-size: 16px;
    }

    .wpcrypto-live-market-coin-row {
        flex-direction: column;
        gap: 8px;
    }

    .wpcrypto-live-market-coin-input {
        min-width: auto;
        width: 100%;
    }

    .wpcrypto-mobile-card-row {
        flex-direction: column;
        gap: 4px;
    }

    .wpcrypto-mobile-card-label {
        min-width: auto;
    }

    .wpcrypto-mobile-card-content {
        margin-left: 0;
        width: 100%;
    }
}

button:focus,
select:focus,
input:focus,
a:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}