/* ==========================
   Xharmonics Premium Theme
   Dark + Scientific + Elegant
   ========================== */

/* === BASE === */
QMainWindow, QWidget {
    background-color: #1b1e25;
    color: #e6e9ef;
    font-family: "Segoe UI", "Roboto", "Ubuntu";
    font-size: 13px;
    border: none;
}

/* === GROUP BOX === */
QGroupBox {
    border: 1px solid #2d3038;
    border-radius: 8px;
    margin-top: 8px;
    background-color: #20232b;
    font-weight: bold;
    color: #dce0e8;
}
QGroupBox::title {
    subcontrol-origin: margin;
    left: 10px;
    padding: 0 8px;
    color: #7aa2f7;
}

/* === BUTTONS === */
QPushButton {
    background-color: #2b2f38;
    color: #e5e7eb;
    border: 1px solid #3b3f49;
    border-radius: 6px;
    padding: 6px 12px;
}
QPushButton:hover {
    background-color: #3b82f6;
    border-color: #60a5fa;
}
QPushButton:pressed {
    background-color: #4f46e5;
    border-color: #7c3aed;
}
QPushButton:disabled {
    background-color: #2a2d35;
    color: #6b7280;
}

/* === LABELS === */
QLabel {
    color: #d1d5db;
}

/* === COMBOBOX === */
QComboBox {
    background-color: #2b2f38;
    color: #e5e7eb;
    border: 1px solid #3b3f49;
    border-radius: 6px;
    padding: 4px 8px;
}
QComboBox:hover {
    border-color: #7aa2f7;
}
QComboBox QAbstractItemView {
    background-color: #20232b;
    border: 1px solid #3b3f49;
    selection-background-color: #4f46e5;
    color: #f3f4f6;
}

/* === SLIDERS === */
QSlider::groove:horizontal {
    border: none;
    height: 6px;
    background: #2f343e;
    border-radius: 3px;
}
QSlider::handle:horizontal {
    background: qlineargradient(
        x1:0, y1:0, x2:1, y2:0,
        stop:0 #7aa2f7, stop:1 #a78bfa
    );
    width: 16px;
    height: 16px;
    margin: -5px 0;
    border-radius: 8px;
}
QSlider::handle:horizontal:hover {
    background: qlineargradient(
        x1:0, y1:0, x2:1, y2:0,
        stop:0 #93c5fd, stop:1 #c4b5fd
    );
}

/* === CHECKBOX === */
QCheckBox {
    spacing: 6px;
    color: #e5e7eb;
}
QCheckBox::indicator {
    width: 14px;
    height: 14px;
    border: 1px solid #3f4551;
    border-radius: 3px;
    background: #1f232b;
}
QCheckBox::indicator:checked {
    background-color: #6366f1;
    border: 1px solid #a78bfa;
}

/* === LINE EDITS === */
QLineEdit {
    background-color: #2b2f38;
    color: #f8fafc;
    border: 1px solid #3f4551;
    border-radius: 6px;
    padding: 4px 8px;
}
QLineEdit:focus {
    border-color: #7aa2f7;
}

/* === MENUS === */
QMenu {
    background-color: #1f232b;
    border: 1px solid #2b2f38;
    color: #e5e7eb;
}
QMenu::item:selected {
    background-color: #4f46e5;
}

/* === TOOLTIP === */
QToolTip {
    background-color: #2b2f38;
    color: #f8fafc;
    border: 1px solid #3b3f49;
    padding: 4px;
    border-radius: 4px;
}

/* === SCROLLBARS === */
QScrollBar:vertical, QScrollBar:horizontal {
    background: #1c1f26;
    border: none;
    width: 12px;
    margin: 0;
}
QScrollBar::handle {
    background: #2f343e;
    border-radius: 6px;
}
QScrollBar::handle:hover {
    background: #475569;
}

/* === STATUS BAR === */
QStatusBar {
    background: #1f232b;
    color: #9ca3af;
    border-top: 1px solid #2b2f38;
}

/* === QGraphicsView === */
QGraphicsView {
    background-color: #15181e;
    border: 1px solid #2b2f38;
}

/* === SPINBOX universal (Qt6 seguro) === */
QSpinBox, QDoubleSpinBox {
    background-color: #2b2f38;
    color: #e5e7eb;
    border: 1px solid #3b3f49;
    border-radius: 6px;
    padding-right: 20px;
    selection-background-color: #4f46e5;
}

/* --- Botones up/down --- */
QSpinBox::up-button, QDoubleSpinBox::up-button,
QSpinBox::down-button, QDoubleSpinBox::down-button {
    background-color: #1f232b;
    border: 1px solid #3b3f49;
    width: 18px;
    subcontrol-origin: border;
}

QSpinBox::up-button, QDoubleSpinBox::up-button {
    subcontrol-position: top right;
    border-bottom: none;
    border-top-right-radius: 6px;
}
QSpinBox::down-button, QDoubleSpinBox::down-button {
    subcontrol-position: bottom right;
    border-top: none;
    border-bottom-right-radius: 6px;
}

/* --- Colores al pasar el mouse --- */
QSpinBox::up-button:hover, QDoubleSpinBox::up-button:hover,
QSpinBox::down-button:hover, QDoubleSpinBox::down-button:hover {
    background-color: #3b82f6;
    border-color: #60a5fa;
}

/* --- No definir 'image', deja que Qt pinte las flechas por defecto --- */
QSpinBox::up-arrow, QDoubleSpinBox::up-arrow,
QSpinBox::down-arrow, QDoubleSpinBox::down-arrow {
    width: 10px;
    height: 10px;
}
