* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.control-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.logout-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
}

.condition-info-row {
    background: linear-gradient(90deg, #ffe082 0%, #ffd54f 100%);
    color: #333;
    font-weight: bold;
    padding: 10px 16px;
    border-radius: 6px;
    margin: 12px 0 0 0;
    word-break: break-all;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(255, 213, 79, 0.15);
}

.company-section {
    margin-bottom: 30px;
}

.company-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.company-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.company-header.collapsed {
    border-radius: 8px;
}

.company-name {
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-toggle {
    font-size: 1.5em;
    transition: transform 0.3s ease;
}

.company-toggle.collapsed {
    transform: rotate(-90deg);
}

.company-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
}

.company-stocks {
    background: white;
    border-radius: 0 0 8px 8px;
    border: 1px solid #e9ecef;
    border-top: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.company-stocks.collapsed {
    max-height: 0;
    padding: 0;
    border: none;
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #6c757d;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 30px;
    border: 1px solid #f5c6cb;
}

.stock-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.stock-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stock-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-code {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.stock-company {
    background: #e9ecef;
    color: #495057;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 500;
}

.stock-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.stock-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8em;
    color: #6c757d;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
}

.detail-value.profit {
    color: #dc3545;
    font-weight: 600;
}

.detail-value.loss {
    color: #28a745;
    font-weight: 600;
}

.detail-value.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #6c757d;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .stock-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats {
        justify-content: center;
    }
} 