* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

h1 {
    font-size: 1.6rem;
    color: #0d6efd;
}

.search-container {
    display: flex;
    max-width: 300px;
}

.search-container input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    width: 100%;
    outline: none;
}

.search-container button {
    padding: 8px 12px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.filter-container select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}

/* Tab Navigation Styles */
.tabs-container {
    margin-bottom: 20px;
}

.tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

#tabs-list {
    display: flex;
    list-style: none;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 5px;
    flex-grow: 1;
}

.tab {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #ddd;
    border-bottom: none;
    position: relative;
}

.tab.active {
    background-color: #fff;
    font-weight: 600;
    border-bottom: 2px solid #0d6efd;
}

#new-tab-button {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    margin-left: 10px;
    white-space: nowrap;
}

.tab-controls {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.tab-controls.active {
    display: block;
}

.add-stock-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#add-stock-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    min-width: 250px;
}

#add-stock-button, 
#remove-stock-button, 
#rename-tab-button, 
#delete-tab-button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #0d6efd;
    color: white;
}

.danger-btn {
    background-color: #dc3545 !important;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-form {
    margin-top: 15px;
}

.modal-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.modal-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-buttons button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#cancel-modal-button {
    background-color: #f0f0f0;
}

#save-tab-button {
    background-color: #0d6efd;
    color: white;
}

/* Stock Table Styles */
.stock-table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    table-layout: fixed;
}

thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #5c5c5c;
    border-bottom: 1px solid #eee;
}

th.select-all {
    width: 40px;
    text-align: center;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

td.checkbox-cell {
    text-align: center;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

.loading-message {
    text-align: center;
    padding: 30px;
    color: #888;
}

/* Stock Row Highlight */
tr.selected {
    background-color: #e8f0fe;
}

/* Cell Styles */
.price-up {
    color: #26a69a;
}

.price-down {
    color: #ef5350;
}

.price-unchanged {
    color: #ffb74d;
}

.flash-up {
    animation: flash-green-animation 2s;
}

.flash-down {
    animation: flash-red-animation 2s;
}

.flash-unchanged {
    animation: flash-yellow-animation 2s;
}

@keyframes flash-green-animation {
    0% { background-color: rgba(38, 166, 154, 0.3); }
    100% { background-color: transparent; }
}

@keyframes flash-red-animation {
    0% { background-color: rgba(239, 83, 80, 0.3); }
    100% { background-color: transparent; }
}

@keyframes flash-yellow-animation {
    0% { background-color: rgba(255, 183, 77, 0.3); }
    100% { background-color: transparent; }
}

.stock-id {
    font-weight: 600;
}

.updated-time {
    font-size: 0.75rem;
    color: #777;
}

/* Set column widths for better performance */
th:nth-child(1), td:nth-child(1) { width: 3%; } /* Checkbox */
th:nth-child(2), td:nth-child(2) { width: 8%; } /* Symbol */
th:nth-child(3), td:nth-child(3) { width: 10%; } /* Price */
th:nth-child(4), td:nth-child(4) { width: 10%; } /* Change */
th:nth-child(5), td:nth-child(5) { width: 8%; } /* Percent */
th:nth-child(6), td:nth-child(6) { width: 10%; } /* Ref */
th:nth-child(7), td:nth-child(7) { width: 9%; } /* Ceiling */
th:nth-child(8), td:nth-child(8) { width: 9%; } /* Floor */
th:nth-child(9), td:nth-child(9) { width: 18%; } /* Time */
th:nth-child(10), td:nth-child(10) { width: 15%; } /* Exchange */

/* Hardware acceleration for animations */
.flash-up, .flash-down, .flash-unchanged {
    will-change: background-color;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Responsive layout */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
    }
    
    .filter-container select {
        width: 100%;
    }
    
    .tabs-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #tabs-list {
        width: 100%;
        overflow-x: auto;
        margin-bottom: 10px;
    }
    
    #new-tab-button {
        margin-left: 0;
        margin-bottom: 10px;
    }
    
    .add-stock-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    #add-stock-input {
        width: 100%;
    }
} 