/* /css/components_styling.css */

*:disabled,
*.disabled,
*[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(30%);
    transition: all 0.2s ease;


    button: disabled,
    .modal__button: disabled,
    button[aria-disabled="true"] {
    background-color: #e0e0e0;
    border-color: #c0c0c0;
    color: #9e9e9e;
    box-shadow: none;

    &: hover {
    background-color: #e0e0e0;
    transform: none;
}

&:active {
    transform: none;
}
}

input:disabled,
textarea:disabled,
select:disabled,
.modal__input:disabled {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
    
    &::placeholder {
    color: #bbb;
    }
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
accent-color: #999;
cursor: not-allowed;

& + label {
    color: #999;
    cursor: not-allowed;
    }
}

a:disabled,
a.disabled,
a[aria-disabled="true"] {
    color: #999;
    text-decoration: none;
    border-bottom: 1px dashed #999;
}

/* Disabled select dropdowns */
select:disabled {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
background-repeat: no-repeat;
background-position: right 8px center;
background-size: 16px;
}

/* Disabled fieldset */
fieldset:disabled {
border-color: #ddd;

& > legend {
color: #999;
}
}

/* Disabled labels */
label:has(input:disabled),
label:has(select:disabled),
label:has(textarea:disabled) {
color: #999;
cursor: not-allowed;
}

/* Disabled tabs/navigation items */
.modal__tab:disabled,
.modal__nav-item.disabled {
background-color: transparent;
color: #999;
border-bottom-color: transparent;
}

/* Disabled icons */
.modal__icon:disabled,
.modal__icon.disabled {
opacity: 0.5;
filter: grayscale(100%);
}

/* Disabled tooltips trigger */
[data-tooltip]:disabled,
[data-tooltip].disabled {
&::before,
&::after {
display: none;
}
}

/* Disabled dropdown triggers */
.modal__dropdown-trigger:disabled {
& + .modal__dropdown-menu {
display: none;
}
}

/* Disabled card/container elements */
.modal__card.disabled,
.modal__section.disabled {
background-color: #fafafa;
border-color: #eee;

& > * {
opacity: 0.8;
}
}

/* Animation for disabled elements */
.modal__fade-out:disabled {
animation: modalDisableFade 0.3s ease;
}
}

/* Dark mode support */
.modal.modal--dark {
*: disabled,
*.disabled,
*[aria-disabled="true"] {
opacity: 0.5;
filter: grayscale(40%);
}

button:disabled {
background-color: #3a3a3a;
border-color: #4a4a4a;
color: #7a7a7a;
}

input:disabled,
textarea:disabled,
select:disabled {
background-color: #2a2a2a;
border-color: #3a3a3a;
color: #6a6a6a;

&::placeholder {
color: #5a5a5a;
}
}
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
.modal *:disabled {
transition: none;
animation: none;
}
}

/* Keyframe animations */
@keyframes modalDisableFade {
from {
opacity: 1;
filter: grayscale(0%);
}
to {
opacity: 0.6;
filter: grayscale(30%);
}
}

/* Accessibility - ensure sufficient contrast */
@media (prefers-contrast: high) {
.modal *:disabled {
opacity: 0.4;
filter: grayscale(50%);
border: 1px dotted #666;
}
}

/* Print styles */
@media print {
.modal *:disabled {
opacity: 1;
filter: none;
border: 1px dashed #000;
}
}

.search-container {
    position: relative;
    width: 100%;
}

.search-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 4px;
    gap: 5px;
}

.search-dropdown.active {
    display: block;
}

.dropdown-item {
    display: flex;
    flex-direction: column;

    padding: 10px 12px;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);

    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--hover-color, #f5f5f5);
}

.dropdown-item.active {
    background-color: var(--primary-light, #e3f2fd);
}

.artist-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.artist-names {
    font-size: 10px;
    color: var(--text-muted, #666);
}

.dropdown-item.no-results {
    cursor: default;
    color: var(--text-muted, #666);
    font-style: italic;
}

.dropdown-item.no-results:hover {
    background-color: transparent;
}


.charts-grid {
margin-top: 20px;
}

.chart-container {
position: relative;
height: 400px;
width: 100%;
}

/* Top Releases Card Styles */
.releases-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 16px;
padding: 16px 0;
}

.release-card {
background: var(--bg-secondary);
border-radius: 12px;
padding: 16px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
display: flex;
align-items: center;
gap: 16px;
border: 1px solid var(--border-color, #e0e0e0);
}

.release-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.release-rank {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 18px;
flex-shrink: 0;
}

.release-info {
flex: 1;
min-width: 0;
}

.release-name {
font-weight: 600;
font-size: 16px;
margin-bottom: 4px;
color: var(--text-primary, #333);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.release-performers {
font-size: 14px;
color: var(--text-secondary, #666);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.release-stats {
display: flex;
align-items: center;
gap: 8px;
margin-top: 8px;
}

.streams-count {
background: var(--primary-light, #f0f4ff);
color: var(--primary-color, #667eea);
padding: 4px 12px;
border-radius: 20px;
font-size: 14px;
font-weight: 600;
display: flex;
align-items: center;
gap: 4px;
}

.streams-count::before {
content: '🎵';
font-size: 12px;
}

.release-id {
font-size: 12px;
color: var(--text-tertiary, #999);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
.release-card {
background: var(--card-bg-dark, #1a1a1a);
border-color: var(--border-color-dark, #333);
}

.release-name {
color: var(--text-primary-dark, #fff);
}

.release-performers {
color: var(--text-secondary-dark, #aaa);
}

.streams-count {
background: rgba(102, 126, 234, 0.2);
color: var(--primary-color-dark, #8a9ef0);
}
}

/* Table view fallback */
.releases-table {
width: 100%;
border-collapse: collapse;
}

.releases-table th,
.releases-table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.releases-table th {
font-weight: 600;
color: var(--text-secondary, #666);
background: var(--table-header-bg, #f5f5f5);
}

.releases-table tr:hover {
background: var(--table-row-hover, #f9f9f9);
}

.form-info {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    gap: 5px;
}

.form-info .info {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}