/* ============================================
   XDEX Liquidity Page Action Buttons
   ============================================ */

/* Action Button Container */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px;
}

/* Base Action Button Styles */
.btn-action-xs, .btn-action-sm, .btn-action-md {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}

/* Size Variants */
.btn-action-xs {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 8px;
    padding: 0;
}

.btn-action-sm {
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 8px;
    padding: 0;
}

.btn-action-md {
    padding: 10px 20px;
    height: 44px;
    font-size: 14px;
    border-radius: 8px;
    min-width: 140px;
    white-space: nowrap;
}

/* Special classes for top buttons */
.create-pool-btn, .refresh-pools-btn {
    padding: 10px 20px !important;
    height: 44px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    min-width: 140px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure proper spacing between icon and text */
.create-pool-btn .fas,
.refresh-pools-btn .fas {
    margin-right: 8px !important;
}

/* Action button responsive adjustments */
@media (max-width: 768px) {
    .create-pool-btn, .refresh-pools-btn {
        padding: 8px 16px !important;
        height: 40px !important;
        font-size: 13px !important;
        min-width: 120px !important;
    }

    .create-pool-btn .fas,
    .refresh-pools-btn .fas {
        margin-right: 6px !important;
    }
}

/* Light Theme Styles */
.btn-action-xs, .btn-action-sm, .btn-action-md {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-action-xs:hover, .btn-action-sm:hover, .btn-action-md:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-action-xs:active, .btn-action-sm:active, .btn-action-md:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Primary Action Variants */
.add-liquidity-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid #059669;
}

.add-liquidity-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.swap-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 1px solid #2563eb;
}

.swap-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.remove-liquidity-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid #dc2626;
}

.remove-liquidity-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #b91c1c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.create-pool-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: 1px solid #7c3aed;
}

.create-pool-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-color: #6d28d9;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.refresh-pools-btn {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    border: 1px solid #475569;
}

.refresh-pools-btn:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: #334155;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

/* Dark Theme Styles */
[data-theme="dark"] .btn-action-xs,
[data-theme="dark"] .btn-action-sm,
[data-theme="dark"] .btn-action-md,
.dark .btn-action-xs,
.dark .btn-action-sm,
.dark .btn-action-md {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-action-xs:hover,
[data-theme="dark"] .btn-action-sm:hover,
[data-theme="dark"] .btn-action-md:hover,
.dark .btn-action-xs:hover,
.dark .btn-action-sm:hover,
.dark .btn-action-md:hover {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Dark Theme Primary Variants */
[data-theme="dark"] .add-liquidity-btn,
.dark .add-liquidity-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid #059669;
}

[data-theme="dark"] .add-liquidity-btn:hover,
.dark .add-liquidity-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .swap-btn,
.dark .swap-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 1px solid #2563eb;
}

[data-theme="dark"] .swap-btn:hover,
.dark .swap-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .remove-liquidity-btn,
.dark .remove-liquidity-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid #dc2626;
}

[data-theme="dark"] .remove-liquidity-btn:hover,
.dark .remove-liquidity-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #b91c1c;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Disabled States */
.btn-action-xs:disabled,
.btn-action-sm:disabled,
.btn-action-md:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading State */
.btn-action-loading {
    position: relative;
    color: transparent !important;
}

.btn-action-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    color: inherit;
}

[data-theme="dark"] .btn-action-loading::after,
.dark .btn-action-loading::after {
    border-top-color: #f1f5f9;
}

/* Spin Animation */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Icon Styles */
.btn-action-xs i,
.btn-action-sm i,
.btn-action-md i {
    font-size: inherit;
    line-height: 1;
    display: inline-block;
}

.btn-action-xs i {
    font-size: 14px;
}

.btn-action-sm i {
    font-size: 16px;
}

.btn-action-md i {
    font-size: 14px;
}

/* Ensure Font Awesome icons are properly loaded */
.btn-action-xs .fas,
.btn-action-sm .fas,
.btn-action-md .fas {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Margin for icons with text */
.btn-action-md .fas.me-2 {
    margin-right: 6px !important;
}

/* Tooltip Styles for Action Buttons */
.btn-action-xs[title],
.btn-action-sm[title],
.btn-action-md[title] {
    position: relative;
}

.btn-action-xs[title]:hover::before,
.btn-action-sm[title]:hover::before,
.btn-action-md[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-action-xs[title]:hover::after,
.btn-action-sm[title]:hover::after,
.btn-action-md[title]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-buttons {
        gap: 6px;
    }

    .btn-action-xs {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .btn-action-sm {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .btn-action-md {
        padding: 6px 12px;
        height: 36px;
        font-size: 13px;
        min-width: 80px;
    }
}

/* Favorite Button Styles */
.favorite-btn {
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Font Awesome 6 Free";
    font-weight: 400; /* Regular star */
}

.favorite-btn:hover {
    color: #fbbf24;
    transform: scale(1.1);
    font-weight: 900; /* Solid star on hover */
}

.favorite-btn.active {
    color: #f59e0b;
    font-weight: 900; /* Solid star when active */
}

[data-theme="dark"] .favorite-btn,
.dark .favorite-btn {
    color: #64748b;
}

[data-theme="dark"] .favorite-btn:hover,
.dark .favorite-btn:hover {
    color: #fbbf24;
}

[data-theme="dark"] .favorite-btn.active,
.dark .favorite-btn.active {
    color: #f59e0b;
}

/* Pool Status Indicators */
.pool-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.pool-status.active {
    background: #dcfce7;
    color: #166534;
}

.pool-status.active .fas {
    color: #22c55e;
    animation: pulse 2s infinite;
}

.pool-status.inactive {
    background: #fef2f2;
    color: #991b1b;
}

.pool-status.inactive .fas {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

[data-theme="dark"] .pool-status.active,
.dark .pool-status.active {
    background: #14532d;
    color: #bbf7d0;
}

[data-theme="dark"] .pool-status.inactive,
.dark .pool-status.inactive {
    background: #7f1d1d;
    color: #fecaca;
}

/* Additional Dark Theme Text Support */
[data-theme="dark"] .pool-info,
.dark .pool-info {
    color: #f8fafc;
}

[data-theme="dark"] .pool-details,
.dark .pool-details {
    color: #f8fafc;
}

[data-theme="dark"] .pool-name,
.dark .pool-name {
    color: #ffffff !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .pool-fee,
.dark .pool-fee {
    color: #cbd5e1 !important;
    opacity: 0.9 !important;
}

[data-theme="dark"] .amount-primary,
.dark .amount-primary {
    color: #f8fafc !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .amount-success,
.dark .amount-success {
    color: #4ade80 !important;
    font-weight: 600 !important;
}
.dark .amount-success {
    color: #68d391 !important;
}

[data-theme="dark"] .tvl-change,
[data-theme="dark"] .volume-change,
.dark .tvl-change,
.dark .volume-change {
    opacity: 0.9;
}

[data-theme="dark"] .apy-badge,
.dark .apy-badge {
    color: inherit;
    opacity: 0.95;
}

[data-theme="dark"] table,
[data-theme="dark"] .table,
.dark table,
.dark .table {
    color: #f8fafc;
}

[data-theme="dark"] th,
[data-theme="dark"] td,
.dark th,
.dark td {
    color: #f8fafc !important;
    border-color: #374151 !important;
}

[data-theme="dark"] .text-end,
.dark .text-end {
    color: #f8fafc !important;
}
