* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1922 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Magical Background Effects */
.magic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(75, 0, 130, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(72, 61, 139, 0.05) 0%, transparent 70%);
    z-index: -1;
}

/* Header */
.header {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: #9370db;
}

.logo i {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.wallet-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.wallet-input {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(147, 112, 219, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.3s ease;
}

.wallet-input:focus {
    outline: none;
    border-color: #9370db;
    box-shadow: 0 0 15px rgba(147, 112, 219, 0.3);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #32cd32, #228b22);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(50, 205, 50, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #9370db, #6a4c93);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(147, 112, 219, 0.3);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Portfolio Section */
.portfolio-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: bold;
}

.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(147, 112, 219, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(147, 112, 219, 0.2);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #32cd32;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.expandable {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-top: 1rem;
    overflow: hidden;
}

.expandable-header {
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(147, 112, 219, 0.1);
    transition: background 0.3s ease;
}

.expandable-header:hover {
    background: rgba(147, 112, 219, 0.2);
}

.expandable-content {
    padding: 1rem;
    display: none;
}

.expandable.open .expandable-content {
    display: block;
}

.expandable.open .expandable-header i {
    transform: rotate(180deg);
}

.time-period {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.time-period:last-child {
    border-bottom: none;
}

/* Pools Section */
.pools-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
}

.pool-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.pool-table th {
    background: rgba(147, 112, 219, 0.2);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 5px;
}

.pool-table th:hover {
    background: rgba(147, 112, 219, 0.3);
}

.pool-row {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(147, 112, 219, 0.2);
    border-radius: 15px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.pool-row:hover {
    border-color: rgba(147, 112, 219, 0.5);
    box-shadow: 0 5px 20px rgba(147, 112, 219, 0.1);
}

.pool-row table {
    width: 100%;
    border-collapse: collapse;
}

.pool-row td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
}

.pool-row tr:last-child td {
    border-bottom: none;
}

.token-pair {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #ffd700;
}

.in-range {
    color: #32cd32;
    font-weight: 600;
}

.out-range {
    color: #ff6b6b;
    font-weight: 600;
}

.location-link {
    color: #9370db;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.location-link:hover {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.loading-pools {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: #b0b0b0;
}

/* AI Assistant */
.ai-assistant {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.ai-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4a90e2, #7b68ee);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 20px rgba(75, 104, 238, 0.3);
}

.ai-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(75, 104, 238, 0.4);
}

.ai-avatar i {
    color: white;
    font-size: 1.5rem;
}

.ai-chat {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: none;
    flex-direction: column;
}

.ai-chat.open {
    display: flex;
}

.ai-chat-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-chat-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.ai-chat-input {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.5rem;
}

.ai-chat-input input {
    flex: 1;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    font-size: 0.9rem;
}

.ai-chat-input input:focus {
    outline: none;
    border-color: #4a90e2;
}

.ai-chat-input button {
    padding: 0.5rem;
    background: #4a90e2;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ai-chat-input button:hover {
    background: #357abd;
}

.ai-message {
    background: rgba(75, 104, 238, 0.2);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.user-message {
    background: rgba(147, 112, 219, 0.2);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    margin-left: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .wallet-section {
        flex-direction: column;
        width: 100%;
    }

    .wallet-input {
        width: 100%;
    }

    .container {
        padding: 1rem;
    }

    .portfolio-stats {
        grid-template-columns: 1fr;
    }

    .pool-table {
        font-size: 0.8rem;
    }

    .pool-table th,
    .pool-table td {
        padding: 0.5rem;
    }

    .ai-chat {
        width: 300px;
        height: 350px;
    }
}

@media (max-width: 480px) {
    .ai-chat {
        width: calc(100vw - 4rem);
        right: 1rem;
    }

    .section-header {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(147, 112, 219, 0.3);
    border-radius: 50%;
    border-top-color: #9370db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error States */
.success { color: #32cd32; }
.error { color: #ff6b6b; }
.warning { color: #ffa500; }
.info { color: #4a90e2; }

/* Animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Sorting indicators */
.sort-asc::after {
    content: ' ↑';
    color: #32cd32;
}

.sort-desc::after {
    content: ' ↓';
    color: #ff6b6b;
}

/* AI Typing Indicator */
.ai-typing-indicator {
    background: rgba(75, 104, 238, 0.1);
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    display: flex;
    justify-content: center;
}

.ai-typing-indicator span {
    animation: blink 1.5s infinite;
    margin: 0 2px;
}

.ai-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

.ai-message.error {
    background: rgba(255, 107, 107, 0.2);
}

/* Pool Rebalancing Styles */
.rebalance-cell {
    text-align: center;
    padding: 0.5rem;
}

.rebalance-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.rebalance-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.rebalance-toggle input:checked + .toggle-slider {
    background-color: #32cd32;
}

.rebalance-toggle input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Rebalancing Notifications */
.rebalancing-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b6b, #ff8c00);
    color: white;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
}

.notification-header button {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-body {
    padding: 15px;
    color: #333;
}

.alert-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-item.critical {
    background-color: #ffebee;
    border-color: #f44336;
}

.alert-item.high {
    background-color: #fff3e0;
    border-color: #ff9800;
}

.alert-item.medium {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.recommendation {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Select All Pools Button */
.rebalance-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.select-all-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-settings {
    display: flex;
    gap: 10px;
}

.notification-settings button {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-settings button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Notification Modal */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.notification-option {
    margin-bottom: 20px;
}

.notification-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}

.notification-option input[type="text"],
.notification-option input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.threshold-settings {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.threshold-settings h3 {
    margin-bottom: 15px;
    color: #333;
}

.threshold-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.threshold-option label {
    color: #666;
}

.threshold-option input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.modal-footer .btn {
    padding: 10px 20px;
} 