/* Common UI Elements */

.btn-primary {
    background-color: var(--accent-color);
    color: #000;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-s);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-s);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
}

.btn-icon:hover {
    color: var(--accent-color);
}

.full-width {
    width: 100%;
}

/* Control Groups */
.control-group {
    margin-bottom: 12px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.divider-mini {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 16px 0;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.slider-with-val {
    display: flex;
    align-items: center;
    gap: 12px;
}

.value-tag {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--accent-color);
    min-width: 40px;
    text-align: right;
}

/* Inputs */
input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: #2a2a2e;
    height: 3px;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(232, 122, 50, 0.3);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(232, 122, 50, 0.5);
}

select {
    width: 100%;
    background: #1a1a1c;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px;
    border-radius: var(--radius-s);
    font-size: 0.85rem;
    outline: none;
}

select:focus {
    border-color: var(--accent-color);
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(232,122,50,0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-m);
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-color);
    margin: 0;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Export List */
.export-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-s);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.export-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(232, 122, 50, 0.3);
}

.export-item-info {
    flex: 1;
    min-width: 0;
    margin-right: 16px;
}

.export-item-name {
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.export-item-status {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.btn-save-as {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-s);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-save-as:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-save-as.done {
    background: #43a047;
    color: #fff;
    pointer-events: none;
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-dim);
    user-select: none;
    transition: var(--transition);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.1);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-text-tiny {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.btn-text-tiny:hover {
    opacity: 1;
    text-decoration: underline;
}
