* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.container {
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
}

body.indices-page .container {
    max-width: none;
    width: auto;
    min-width: fit-content;
    margin-left: 20px;
    margin-right: 20px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.4);
}

.btn-delete {
    background: #f56565;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.btn-delete:hover {
    background: #e53e3e;
}

.crypto-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.crypto-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.crypto-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.crypto-card.edit-mode {
    background: #fef3c7;
    border-color: #fcd34d;
}

.crypto-name {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.crypto-name:hover {
    color: #764ba2;
    text-decoration: underline;
}

.crypto-name-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
}

.crypto-field {
    margin-bottom: 12px;
    font-size: 14px;
    color: #4a5568;
}

.crypto-label {
    font-weight: 600;
    color: #2d3748;
    display: inline-block;
    min-width: 100px;
}

.crypto-value {
    color: #667eea;
    font-weight: 500;
}

.edit-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.edit-actions button {
    flex: 1;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

#modalTitle {
    margin-bottom: 20px;
    color: #2d3748;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-search {
    margin-bottom: 15px;
}

.modal-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.modal-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.coin-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

.coin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.coin-item:last-child {
    border-bottom: none;
}

.coin-item:hover {
    background-color: #f7fafc;
}

.coin-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
}

.coin-item-info {
    flex: 1;
}

.coin-item-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.coin-item-symbol {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
}

.loading-text {
    text-align: center;
    padding: 20px;
    color: #718096;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Navigation */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

.nav-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.nav-link.active {
    color: #2d3748;
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}

.nav-divider {
    color: #cbd5e0;
}

/* Indices page styles */
.indices-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.indice-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.indice-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.indice-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 8px;
}

.indice-logo {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    background: #e6f0ff;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 70px;
    text-align: center;
    line-height: 1;
}

.indice-symbol {
    background: #e6f0ff;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.indice-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.data-row .label {
    font-size: 12px;
    color: #2d3748;
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
}

.data-row .value {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    text-align: right;
}

.data-row .value.positive {
    color: #22863a;
}

.data-row .value.negative {
    color: #cb2431;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.error {
    text-align: center;
    padding: 40px;
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 8px;
    color: #c53030;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .crypto-list {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
