/* Modern light theme - IBM Carbon Design System inspired */
/* Unified with plugin styles for consistency */

/* ========== GLOBAL STYLES ========== */

QWidget {
    background-color: #FFFFFF;
    color: #161616;
    font-family: 'Segoe UI', 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
}

QMainWindow {
    background-color: #FFFFFF;
    border: none;
}

/* ========== SIDEBAR ========== */

QFrame[objectName="SidebarTabs"], SidebarTabs {
    background-color: #F2F2F2;
    border-right: 1px solid #D9D9D9;
}

/* ========== BUTTONS ========== */

/* Default button (secondary style) */
QPushButton {
    background-color: #F2F2F2;
    color: #333333;
    border: 1px solid #D9D9D9;
    border-radius: 15px;
    padding: 8px 16px;
    text-align: center;
    min-height: 20px;
    font-weight: 600;
}

QPushButton:hover {
    background-color: #D9D9D9;
    border: 1px solid #D9D9D9;
}

QPushButton:pressed {
    background-color: #C6C6C6;
    border: 1px solid #A6A6A6;
}

QPushButton:disabled {
    background-color: #F5F5F5;
    border: 1px solid #E0E0E0;
    color: #A8A8A8;
}

/* PRIMARY BUTTON */
QPushButton[role="primary"] {
    background-color: #0F62FE;
    color: white;
    border-radius: 15px;
    padding: 10px 20px;
    font-weight: 600;
    border: none;
}

QPushButton[role="primary"]:hover {
    background-color: #0353E9;
}

QPushButton[role="primary"]:pressed {
    background-color: #002D9C;
}

QPushButton[role="primary"]:disabled {
    background-color: #C6C6C6;
    color: #8D8D8D;
}

/* PRIMARY BUTTON SMALL */
QPushButton#primarySmallButton {
    background-color: #0F62FE;
    color: white;
    border-radius: 12px;
    padding: 4px 10px;
    font-weight: 600;
    font-size: 12px;
    border: none;
}

QPushButton#primarySmallButton:hover {
    background-color: #0353E9;
}

QPushButton#primarySmallButton:pressed {
    background-color: #002D9C;
}

QPushButton#primarySmallButton:disabled {
    background-color: #C6C6C6;
    color: #8D8D8D;
}

/* SECONDARY BUTTON */
QPushButton[role="secondary"] {
    background-color: #F2F2F2;
    color: #333333;
    border-radius: 15px;
    padding: 10px 20px;
    font-weight: 600;
    border: 1px solid #D9D9D9;
}

QPushButton[role="secondary"]:hover {
    background-color: #D9D9D9;
    border: 1px solid #D9D9D9;
}

QPushButton[role="secondary"]:pressed {
    background-color: #C6C6C6;
    border: 1px solid #A6A6A6;
}

QPushButton[role="secondary"]:disabled {
    background-color: #F5F5F5;
    border: 1px solid #E0E0E0;
    color: #A8A8A8;
}

/* SECONDARY BUTTON SMALL */
QPushButton#secondarySmallButton {
    background-color: #F2F2F2;
    color: #333333;
    border-radius: 12px;
    padding: 4px 10px;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid #D9D9D9;
}

QPushButton#secondarySmallButton:hover {
    background-color: #D9D9D9;
    border: 1px solid #D9D9D9;
}

QPushButton#secondarySmallButton:pressed {
    background-color: #C6C6C6;
    border: 1px solid #A6A6A6;
}

QPushButton#secondarySmallButton:disabled {
    background-color: #F5F5F5;
    border: 1px solid #E0E0E0;
    color: #A8A8A8;
}

/* TERTIARY BUTTON (ghost-style) */
QPushButton[role="tertiary"] {
    background-color: transparent;
    color: #0F62FE;
    border-radius: 15px;
    padding: 10px 20px;
    border: 1px solid #0F62FE;
    font-weight: 600;
}

QPushButton[role="tertiary"]:hover {
    background-color: rgba(15,98,254,0.1);
}

QPushButton[role="tertiary"]:pressed {
    background-color: rgba(15,98,254,0.2);
}

QPushButton[role="tertiary"]:disabled {
    border: 1px solid #D9D9D9;
    color: #A8A8A8;
}

/* TERTIARY BUTTON SMALL */
QPushButton#tertiarySmallButton {
    background-color: transparent;
    color: #0F62FE;
    border-radius: 12px;
    padding: 4px 10px;
    border: 1px solid #0F62FE;
    font-weight: 600;
    font-size: 12px;
}

QPushButton#tertiarySmallButton:hover {
    background-color: rgba(15,98,254,0.1);
}

QPushButton#tertiarySmallButton:pressed {
    background-color: rgba(15,98,254,0.2);
}

QPushButton#tertiarySmallButton:disabled {
    border: 1px solid #D9D9D9;
    color: #A8A8A8;
}

/* DANGER BUTTON */
QPushButton[role="danger"] {
    background-color: #DA1E28;
    color: white;
    border-radius: 15px;
    padding: 10px 20px;
    border: none;
    font-weight: 600;
}

QPushButton[role="danger"]:hover {
    background-color: #B81922;
}

QPushButton[role="danger"]:pressed {
    background-color: #750E13;
}

QPushButton[role="danger"]:disabled {
    background-color: #F5F5F5;
    color: #A8A8A8;
}

/* DANGER BUTTON SMALL */
QPushButton#dangerSmallButton {
    background-color: #DA1E28;
    color: white;
    border-radius: 12px;
    padding: 4px 10px;
    border: none;
    font-weight: 600;
    font-size: 12px;
}

QPushButton#dangerSmallButton:hover {
    background-color: #B81922;
}

QPushButton#dangerSmallButton:pressed {
    background-color: #750E13;
}

QPushButton#dangerSmallButton:disabled {
    background-color: #F5F5F5;
    color: #A8A8A8;
}

/* PRIMARY BUTTON (legacy objectName support) */
QPushButton[objectName="primaryButton"] {
    background-color: #0F62FE;
    color: #FFFFFF;
    border: none;
    border-radius: 15px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
}

QPushButton[objectName="primaryButton"]:hover {
    background-color: #0353E9;
}

QPushButton[objectName="primaryButton"]:pressed {
    background-color: #002D9C;
}

QPushButton[objectName="primaryButton"]:disabled {
    background-color: #C6C6C6;
    color: #8D8D8D;
}

/* LINK BUTTON */
QPushButton[objectName="linkButton"] {
    background-color: transparent;
    color: #0F62FE;
    border: none;
    padding: 4px 8px;
    text-decoration: underline;
    font-size: 13px;
}

QPushButton[objectName="linkButton"]:hover {
    color: #0353E9;
    background-color: transparent;
}

QPushButton[objectName="linkButton"]:pressed {
    color: #002D9C;
    background-color: transparent;
}

/* ========== INPUT FIELDS ========== */

QLineEdit, QTextEdit {
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    border-radius: 4px;
    padding: 6px 10px;
    color: #161616;
    font-size: 13px;
    font-weight: 500;
}

QLineEdit:focus, QTextEdit:focus {
    border: 1px solid #0F62FE;
}

QLineEdit[objectName="authInput"] {
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    border-radius: 6px;
    padding: 12px 16px;
    color: #161616;
    font-size: 14px;
    min-height: 20px;
}

QLineEdit[objectName="authInput"]:focus {
    border: 2px solid #0F62FE;
}

/* ========== GROUP BOX ========== */

QGroupBox {
    background-color: #F2F2F2;
    border: none;
    border-radius: 10px;
    margin-top: 20px;
    padding: 10px;
    padding-top: 35px;
    font-size: 15px;
    color: #161616;
}

QGroupBox::title {
    subcontrol-origin: padding;
    subcontrol-position: top left;
    padding: 10px 10px;
    margin-left: 0px;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #393939 !important;
    background: transparent;
}

QGroupBox QRadioButton {
    background-color: transparent;
    color: #161616;
    font-size: 13px;
    font-weight: 500;
}

/* Customer portal section with reduced top spacing */
QGroupBox#customerPortalSection {
    margin-top: 10px;
    padding-top: 20px;
}

QGroupBox QLabel {
    background-color: transparent;
    color: #161616;
}

QGroupBox QLineEdit, QGroupBox QTextEdit {
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    border-radius: 4px;
    padding: 6px 10px;
    color: #161616;
}

QGroupBox QLineEdit:focus, QGroupBox QTextEdit:focus {
    border: 1px solid #0F62FE;
}

QGroupBox QComboBox {
    background-color: #FFFFFF;
    color: #161616;
    border: 1px solid #D9D9D9;
    border-radius: 4px;
    padding: 6px 10px;
    min-width: 200px;
    font-size: 13px;
    font-weight: 500;
}

QGroupBox QComboBox:hover {
    border: 1px solid #0F62FE;
}

QGroupBox QComboBox:focus {
    border: 1px solid #0F62FE;
}

QGroupBox QComboBox::drop-down {
    subcontrol-origin: padding;
    subcontrol-position: center right;
    width: 20px;
    border-left: 1px solid #D9D9D9;
    background: transparent;
}

QGroupBox QComboBox::down-arrow {
    width: 0px;
    height: 0px;
    border: none;
}

QGroupBox QComboBox QAbstractItemView {
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    color: #161616;
    selection-background-color: #E8F4FF;
    selection-color: #161616;
}

/* ========== COMBOBOX ========== */

QComboBox {
    background-color: #FFFFFF;
    color: #161616;
    border: 1px solid #D9D9D9;
    border-radius: 4px;
    padding: 6px 10px;
    min-width: 200px;
    font-size: 13px;
    font-weight: 500;
}

QComboBox:hover {
    border: 1px solid #0F62FE;
}

QComboBox:focus {
    border: 1px solid #0F62FE;
}

QComboBox::drop-down {
    subcontrol-origin: padding;
    subcontrol-position: center right;
    width: 20px;
    border-left: 1px solid #D9D9D9;
    background: transparent;
}

QComboBox::down-arrow {
    width: 0px;
    height: 0px;
    border: none;
}

QComboBox QAbstractItemView {
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    color: #161616;
    selection-background-color: #E8F4FF;
    selection-color: #161616;
    outline: none;
}

QComboBox QAbstractItemView::item {
    padding: 6px 10px;
    min-height: 20px;
}

QComboBox QAbstractItemView::item:hover {
    background-color: #F2F2F2;
}

QComboBox QAbstractItemView::item:selected {
    background-color: #E8F4FF;
    color: #161616;
}

/* ========== SCROLLBARS ========== */

QScrollBar:vertical {
    background: transparent;
    width: 6px;
    margin: 2px 0 2px 0;
    border: none;
}

QScrollBar::handle:vertical {
    background: #D9D9D9;
    border-radius: 3px;
    min-height: 20px;
}

QScrollBar::handle:vertical:hover {
    background: #BFBFBF;
}

QScrollBar::handle:vertical:pressed {
    background: #A6A6A6;
}

QScrollBar::sub-line:vertical,
QScrollBar::add-line:vertical {
    height: 0px;
    border: none;
}

QScrollBar:horizontal {
    background: transparent;
    height: 6px;
    margin: 0 2px 0 2px;
    border: none;
}

QScrollBar::handle:horizontal {
    background: #D9D9D9;
    border-radius: 3px;
    min-width: 20px;
}

QScrollBar::handle:horizontal:hover {
    background: #BFBFBF;
}

QScrollBar::handle:horizontal:pressed {
    background: #A6A6A6;
}

QScrollBar::sub-line:horizontal,
QScrollBar::add-line:horizontal {
    width: 0px;
    border: none;
}

/* ========== LABELS ========== */

QLabel {
    color: #161616;
}

QLabel#pluginTitle {
    font-size: 18px;
    font-weight: 700;
    color: #161616;
}

QLabel#pluginDesc {
    font-size: 13px;
    color: #525252;
    font-weight: 500;
}

QLabel#appTitle {
    color: #161616;
    font-size: 18px;
    font-weight: 700;
    background-color: transparent;
}

QLabel#appTitleLarge {
    color: #161616;
    font-size: 28px;
    font-weight: 700;
}

QLabel#authTitle {
    color: #161616;
    font-size: 18px;
    font-weight: 700;
}

QLabel#authSubtitle {
    color: #525252;
    font-size: 14px;
    font-weight: 500;
}

QLabel#dialogHeader {
    color: #161616;
    font-size: 16px;
    font-weight: 700;
}

QLabel#helperText {
    font-size: 12px;
    font-weight: 500;
    color: #525252;
    line-height: 17px;
}

/* ========== MENUS ========== */

QMenuBar {
    background-color: #F2F2F2;
    color: #161616;
    border-bottom: 1px solid #D9D9D9;
}

QMenuBar::item {
    padding: 8px 16px;
    background: transparent;
}

QMenuBar::item:selected {
    background-color: #E0E0E0;
}

QMenu {
    background-color: #FFFFFF;
    color: #161616;
    border: 1px solid #D9D9D9;
    padding: 5px;
}

QMenu::item {
    padding: 8px 30px 8px 20px;
    border-radius: 4px;
}

QMenu::item:selected {
    background-color: #E8F4FF;
}

QMenu::separator {
    height: 1px;
    background-color: #D9D9D9;
    margin: 5px;
}

/* ========== TABS ========== */

/* Auth tab specific styles */
QTabWidget[objectName="authTabWidget"] {
    background-color: transparent;
}

QTabWidget[objectName="authTabWidget"]::pane {
    border: none;
    background-color: transparent;
}

QTabWidget[objectName="authTabWidget"] QTabBar::tab {
    background-color: #F2F2F2;
    color: #161616;
    padding: 12px 24px;
    margin-right: 2px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

QTabWidget[objectName="authTabWidget"] QTabBar::tab:selected {
    background-color: #0F62FE;
    color: #FFFFFF;
}

QTabWidget[objectName="authTabWidget"] QTabBar::tab:hover:!selected {
    background-color: #E0E0E0;
}

/* ========== DIALOGS ========== */

QDialog[objectName="authDialog"] {
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
}

QWidget#appHeader {
    background-color: #FFFFFF;
    border-bottom: 1px solid #D9D9D9;
}

QWidget[objectName="authHeader"] {
    background-color: transparent;
}

/* ========== STATUS BAR ========== */

QStatusBar {
    background-color: #F2F2F2;
    border-top: 1px solid #D9D9D9;
    color: #161616;
    font-family: 'Segoe UI', 'Inter', sans-serif;
    font-size: 12px;
    padding: 4px 0px;
}

QStatusBar::item {
    border: none;
    background: transparent;
}

QStatusBar QLabel {
    background: transparent;
    padding: 2px 4px;
    color: #161616;
}

QStatusBar QWidget {
    background: transparent;
}

QStatusBar {
    text-align: center;
}

/* ========== CHAT INPUT COMPONENTS ========== */

/* Chat send button - circular tertiary button with up arrow inside text input */
QPushButton#chatSendButton {
    background-color: transparent;
    color: #0F62FE;
    border: 1px solid #0F62FE;
    border-radius: 16px;  /* Half of 32px for perfect circle */
    font-size: 18px;  /* Larger arrow */
    font-weight: 600;
    padding: 0px;
}

QPushButton#chatSendButton:hover {
    background-color: rgba(15, 98, 254, 0.1);
    border: 1px solid #0F62FE;
}

QPushButton#chatSendButton:pressed {
    background-color: rgba(15, 98, 254, 0.2);
    border: 1px solid #0353E9;
}

QPushButton#chatSendButton:disabled {
    background-color: transparent;
    border: 1px solid #D9D9D9;
    color: #A8A8A8;
}
