/* ====================================
   Button Components (OPTIMIZED)
   ==================================== */

/* Base Button Styles */
.btn {
    padding: 9px 17px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-raised);
}

.btn:hover {
    color: var(--color-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-raised-hover);
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-pressed);
}

/* Button Variants */
.btn.blast-all,
.btn.top-action-btn {
    font-size: 15px !important;
    padding: 10px 30px !important;
    height: 42px !important;
    min-width: 150px !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-raised) !important;
}

.btn.blast-all:hover,
.btn.top-action-btn:hover {
    color: var(--text-primary) !important;
    transform: none !important;
    box-shadow: var(--shadow-raised) !important;
}

.btn.blast-all.stop {
    color: var(--color-stop) !important;
}

.result-actions .btn {
    font-size: 13px !important;
    padding: 8px 16px !important;
    height: 38px !important;
    min-width: 120px !important;
    color: var(--text-primary) !important;
}

.result-actions .btn.clear {
    color: #ffffff !important;
}

.result-actions .btn:hover {
    transform: none !important;
    box-shadow: var(--shadow-raised) !important;
    color: var(--text-primary) !important;
}

.result-actions .btn.clear:hover {
    color: #ffffff !important;
}

.textarea-header .btn.add,
.msg-controls .btn.add,
.msg-controls .btn.clear {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
}

.msg-controls .btn {
    padding: 0;
    min-width: 36px;
    width: 36px;
    font-size: 14px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    /* Round */
}

.msg-controls .btn:hover {
    transform: none !important;
    box-shadow: var(--shadow-raised) !important;
    background: var(--bg-secondary);
}

/* ========== OPTIMIZED: Base Round Button Class ========== */
/* Shared styles for all round buttons */
.btn-round-base {
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Shared hover state for round buttons */
.btn-round-base:hover {
    color: var(--color-hover);
    box-shadow: var(--shadow-raised-hover);
}

/* Shared active state for round buttons */
.btn-round-base:active {
    box-shadow: var(--shadow-pressed);
}

/* Control Buttons (40px round) */
.btn-control {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-control:hover {
    color: var(--color-hover);
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-raised-hover);
}

.btn-control:active {
    transform: translateY(0) scale(0.95);
    box-shadow: var(--shadow-pressed);
}

.btn-control:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-control:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-raised);
    color: var(--text-primary);
}

/* Icon Buttons (32px round) */
.btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
    margin-left: 6px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-raised);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-icon:hover {
    color: var(--color-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-raised-hover);
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
    box-shadow: var(--shadow-pressed);
}

/* Theme Toggle Button (40px round) */
.theme-toggle {
    position: absolute;
    top: 5px;
    /* Adjusted top for smaller size */
    right: 15px;
    /* Adjusted right */
    width: 40px;
    height: 40px;
    font-size: 20px;
    z-index: 1000;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    box-shadow: var(--shadow-raised);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-4px) rotate(15deg);
    box-shadow: var(--shadow-raised-hover);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.95);
    box-shadow: var(--shadow-pressed);
}

/* Mode Toggle Buttons */
.mode-toggle {
    display: flex;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 12px;
    box-shadow: var(--shadow-inset);
}

.mode-btn {
    padding: 10px 30px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text-secondary);
    min-width: 100px;
}

.mode-btn:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: var(--bg-primary);
    color: var(--text-accent);
    box-shadow: var(--shadow-raised);
    text-shadow: 0 0 8px var(--text-accent);
}


/* Special Button Styles */
.btn.btn-purple {
    background: #9C27B0 !important;
    color: #fff;
    /* Explicitly set white text as was likely default or global */
    border: none;
    /* Removing box-shadow to match flat inline style unless it was global */
}

.btn.btn-purple:hover {
    background: #8e24aa !important;
    /* Slight darken for hover if standard, or keep same if strictly no change. Let's keep a standard hover to imply interactivity but base is solid */
    transform: none;
    /* Removing lift effect */
    box-shadow: none;
    /* Removing shadow */
}

.wa-filter-btn {
    background: linear-gradient(135deg, #E040FB, #9C27B0);
    color: var(--text-primary);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-raised);
    transition: all 0.3s ease;
}

.wa-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-raised-hover);
}

.qr-refresh-btn-header,
.pair-refresh-btn-header {
    color: #10B981;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-primary);
    padding: 5px 12px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-inset-field);
}

.qr-refresh-btn-header:hover,
.pair-refresh-btn-header:hover {
    color: #059669;
    box-shadow: var(--shadow-inset-field);
}

/* Popup Control Buttons */
#qrPopupControls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

#qrPopupControls .btn {
    padding: 8px 15px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
    min-width: 120px;
}

#qrPopupControls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Utility Buttons (Smaller & Less Rounded) */
.btn.utility-btn {
    font-size: 11px !important;
    padding: 5px 12px !important;
    height: 30px !important;
    min-width: unset !important;
    /* Allow auto width */
    width: auto !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-raised) !important;
    gap: 4px;
    border-radius: 8px !important;
    /* Slightly more rounded to match size increase */
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn.utility-btn:hover {
    color: var(--color-hover) !important;
    transform: none !important;
    box-shadow: var(--shadow-raised) !important;
    background: var(--bg-secondary);
}

.btn.utility-btn span {
    color: var(--text-accent);
    font-weight: 800;
}