/* ASX 200 Website Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

header {
    background: white;
    color: #333;
    padding: 2rem 0;
    border-bottom: 2px solid #e67e22;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    padding: 0.35rem;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    text-align: left;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
    font-style: italic;
}

.header-logo {
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.header-logo:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.lab-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.lab-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.intro {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.intro p {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
}

.intro p:last-child {
    margin-bottom: 0;
}

.disclaimer-label {
    color: #e67e22;
    font-weight: 700;
}

.intro p:last-child {
    font-style: italic;
}

.disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.disclaimer p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.disclaimer strong {
    color: #d35400;
}

.disclaimer a {
    color: #d35400;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.disclaimer a:hover {
    color: #e67e22;
    text-decoration: underline;
}

.controls {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    min-width: 180px;
}

.control-group label {
    font-weight: 700;
    color: #e67e22;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    white-space: nowrap;
}

select {
    padding: 0.875rem 1.5rem;
    border: 2px solid #e67e22;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 200px;
    text-align: center;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23e67e22" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

select:hover {
    border-color: #d35400;
}

select:focus {
    outline: none;
    border-color: #d35400;
}

select option {
    padding: 0.5rem;
    background: white;
    color: #2c3e50;
    font-weight: 500;
}

#content {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 400px;
}

.view {
    display: none;
    padding: 2rem;
}

.view.active {
    display: block;
}

#loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.1rem;
    color: #666;
}

.code-snippet-container {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.code-snippet-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.code-snippet-header:hover {
    background: #e9ecef;
}

.code-snippet-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapse-icon {
    font-size: 1rem;
    color: #6c757d;
    transition: transform 0.2s;
    font-family: monospace;
    font-weight: bold;
}

.collapse-icon.collapsed {
    transform: rotate(0deg);
}

.code-snippet-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.code-snippet-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.code-snippet-content.collapsed {
    max-height: 0;
}

.copy-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: #2980b9;
}

.code-snippet {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    margin: 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.table-container {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.companies-table thead {
    background: #e67e22;
    color: white;
}

.companies-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.companies-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

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

.companies-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    font-weight: 600;
    color: #666;
    text-align: center;
    width: 60px;
}

.ticker-cell {
    font-weight: bold;
    color: #2a5298;
    font-family: 'Monaco', 'Courier New', monospace;
    width: 100px;
}

.name-cell {
    color: #333;
    min-width: 250px;
}

.weight-cell {
    font-weight: 600;
    color: #e67e22;
    text-align: right;
    width: 100px;
}

.sector-cell {
    color: #555;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    width: 200px;
}

/* SEO Content */
.seo-content {
    color: #f8f9fa;
    font-size: 1px;
    line-height: 1px;
    margin: 0;
    padding: 0;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header-logo {
        width: 60px;
        height: 60px;
    }
    
    .header-text {
        text-align: center;
    }
    
    header h1 {
        font-size: 1.8rem;
        color: #e67e22;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .disclaimer {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .disclaimer p {
        font-size: 0.85rem;
        text-align: left;
    }
    
    .controls {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .control-group {
        min-width: 100%;
    }
    
    .control-group label {
        font-size: 1rem;
    }
    
    select {
        min-width: 100%;
        font-size: 1rem;
        padding: 0.75rem 1rem;
        padding-right: 40px;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    .companies-table th,
    .companies-table td {
        padding: 0.5rem 0.4rem;
    }
    
    .name-cell {
        min-width: 180px;
    }
    
    .sector-cell {
        width: 150px;
    }
    
    .code-snippet-header {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .code-snippet-left {
        flex: 1;
        min-width: 200px;
    }
    
    .code-snippet {
        font-size: 0.75rem;
    }
}