/**
 * Buttons CSS - Consolidated button styles
 * Extracted from nav-side.css and other button-related styles
 */

/* Import variables */
@import 'variables.css';

/* ===== BUTTON BASE STYLES ===== */

/* Icon Buttons */
.icon-button-stats-toggle,
.icon-button-show-hide-alert-zones-toggle,
.icon-button,
.icon-button-light-dark-toggle {
    font-size: var(--font-size-lg);
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    width: var(--button-size);
    height: var(--button-size);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: var(--z-button);
    padding: 0;
    margin: 0;
}

.icon-button-stats-toggle:hover,
.icon-button-show-hide-alert-zones-toggle:hover,
.icon-button:hover,
.icon-button-light-dark-toggle:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.icon-button-stats-toggle:active,
.icon-button-show-hide-alert-zones-toggle:active,
.icon-button:active,
.icon-button-light-dark-toggle:active {
    background: var(--primary-active);
    transform: translateY(1px);
    box-shadow: var(--shadow-active);
    transition: all 0.1s ease;
}

.icon-button-stats-toggle:focus,
.icon-button-show-hide-alert-zones-toggle:focus,
.icon-button:focus,
.icon-button-light-dark-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-color);
}

/* Active Button States */
.icon-button-stats-toggle.active,
.icon-button-show-hide-alert-zones-toggle.active,
.icon-button-light-dark-toggle.active {
    background-color: var(--selected-color) !important;
    color: var(--text-light) !important;
    transform: scale(1.02) !important;
    box-shadow: var(--shadow-hover) !important;
}

.icon-button-stats-toggle.active:hover,
.icon-button-show-hide-alert-zones-toggle.active:hover,
.icon-button-light-dark-toggle.active:hover {
    background-color: var(--selected-hover) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: var(--shadow-hover) !important;
}

/* Button Ripple Effect */
.icon-button-stats-toggle::after,
.icon-button-show-hide-alert-zones-toggle::after,
.icon-button::after,
.icon-button-light-dark-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.icon-button-stats-toggle:active::after,
.icon-button-show-hide-alert-zones-toggle:active::after,
.icon-button:active::after,
.icon-button-light-dark-toggle:active::after {
    width: 100%;
    height: 100%;
}

/* Button Tooltips */
.nav-side-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--dark-panel);
    color: var(--text-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow);
    z-index: var(--z-tooltip);
}

.icon-button-stats-toggle:hover .nav-side-tooltip,
.icon-button-show-hide-alert-zones-toggle:hover .nav-side-tooltip,
.icon-button:hover .nav-side-tooltip,
.icon-button-light-dark-toggle:hover .nav-side-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-5px);
}

body.light-theme .nav-side-tooltip {
    background-color: var(--light-panel);
    color: var(--text-dark);
}

/* Theme Toggle Specific Styles */
.icon-button-light-dark-toggle.ready {
    animation: pulse 2s infinite;
}

.icon-button-light-dark-toggle.clicked {
    animation: click-feedback 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes click-feedback {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ===== GENERAL BUTTON STYLES ===== */

/* Primary Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    color: var(--text-light);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-secondary {
    color: var(--text-light);
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

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

.btn-danger {
    color: var(--text-light);
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

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

/* Modern Toggle */
.modern-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    background-color: var(--border-color);
    border-radius: 34px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    border: none;
    outline: none;
}

.modern-toggle:hover {
    background-color: var(--border-color-hover);
}

.modern-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 30px;
    height: 30px;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--transition-speed);
}

.modern-toggle.active {
    background-color: var(--primary-color);
}

.modern-toggle.active::after {
    transform: translateX(26px);
}

/* Pagination Buttons */
.pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0.5rem;
    margin: 0 0.2rem;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.pagination-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.pagination-button.active {
    background: var(--selected-color);
}

.pagination-button:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Load More Container */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg);
    margin: var(--spacing-md);
}

.load-more-container .btn {
    min-width: 200px;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 500;
}

/* ===== PROGRESSIVE RESPONSIVE SCALING ===== */

/* Large Mobile and Small Tablet (768px) */
@media (max-width: 768px) {
    .icon-button-stats-toggle,
    .icon-button-show-hide-alert-zones-toggle,
    .icon-button,
    .icon-button-light-dark-toggle {
        width: 42px;
        height: 42px;
        font-size: var(--font-size-md);
        border-radius: 7px;
        box-shadow: var(--shadow-sm);
        margin: 0;
        flex-shrink: 0;
    }

    .nav-side-tooltip {
        font-size: 0.8rem;
        padding: 6px 10px;
        right: calc(100% + 8px);
    }

    .btn {
        padding: 0.65rem 0.9rem;
        font-size: 0.9rem;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modern-toggle {
        width: 52px;
        height: 30px;
    }

    .modern-toggle::after {
        width: 26px;
        height: 26px;
        top: 2px;
        left: 2px;
    }

    .modern-toggle.active::after {
        transform: translateX(22px);
    }

    .pagination-button {
        min-width: 38px;
        min-height: 38px;
        font-size: 0.85rem;
        margin: 0 0.15rem;
    }

    .load-more-container {
        padding: var(--spacing-md);
        margin: var(--spacing-sm);
    }

    .load-more-container .btn {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
    .icon-button-stats-toggle,
    .icon-button-show-hide-alert-zones-toggle,
    .icon-button,
    .icon-button-light-dark-toggle {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
        border-radius: 6px;
    }

    .nav-side-tooltip {
        font-size: 0.75rem;
        padding: 5px 8px;
        right: calc(100% + 6px);
    }

    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-height: 38px;
    }

    .modern-toggle {
        width: 46px;
        height: 26px;
    }

    .modern-toggle::after {
        width: 22px;
        height: 22px;
        top: 2px;
        left: 2px;
    }

    .modern-toggle.active::after {
        transform: translateX(20px);
    }

    .pagination-button {
        min-width: 36px;
        min-height: 36px;
        font-size: 0.8rem;
        margin: 0 0.1rem;
        padding: 0.4rem;
    }

    .load-more-container {
        padding: var(--spacing-sm);
        margin: var(--spacing-xs);
    }
}

/* Extra Small Mobile (360px) */
@media (max-width: 360px) {
    .icon-button-stats-toggle,
    .icon-button-show-hide-alert-zones-toggle,
    .icon-button,
    .icon-button-light-dark-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
        border-radius: 5px;
    }

    .nav-side-tooltip {
        display: none; /* Hide tooltips on very small screens to save space */
    }

    .btn {
        padding: 0.55rem 0.7rem;
        font-size: 0.8rem;
        min-height: 34px;
    }

    .modern-toggle {
        width: 40px;
        height: 22px;
    }

    .modern-toggle::after {
        width: 18px;
        height: 18px;
        top: 2px;
        left: 2px;
    }

    .modern-toggle.active::after {
        transform: translateX(18px);
    }

    .pagination-button {
        min-width: 32px;
        min-height: 32px;
        font-size: 0.75rem;
        margin: 0 0.05rem;
        padding: 0.35rem;
    }

    .load-more-container {
        padding: 8px;
        margin: 6px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */

@media (hover: none) and (pointer: coarse) {
    .icon-button-stats-toggle,
    .icon-button-show-hide-alert-zones-toggle,
    .icon-button,
    .icon-button-light-dark-toggle {
        min-width: 44px;
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.3);
    }

    .icon-button-stats-toggle:hover,
    .icon-button-show-hide-alert-zones-toggle:hover,
    .icon-button:hover,
    .icon-button-light-dark-toggle:hover {
        transform: none;
    }

    .icon-button-stats-toggle:active,
    .icon-button-show-hide-alert-zones-toggle:active,
    .icon-button:active,
    .icon-button-light-dark-toggle:active {
        transform: scale(0.95);
        background: var(--primary-active);
    }

    .btn {
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.3);
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .icon-button-stats-toggle,
    .icon-button-show-hide-alert-zones-toggle,
    .icon-button,
    .icon-button-light-dark-toggle {
        border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}

/* ===== BUTTON ICONS ===== */

.icon-button-stats-toggle i,
.icon-button-show-hide-alert-zones-toggle i,
.icon-button i,
.icon-button-light-dark-toggle i {
    transition: transform var(--transition-speed);
}

.icon-button-stats-toggle.active i {
    transform: rotate(180deg);
}

/* ===== BUTTON STATES ===== */

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-color-alpha);
}

.btn:active {
    transform: translateY(0);
}

/* ===== BUTTON GROUPS ===== */

.button-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 120px;
}

/* Responsive button groups */
@media (max-width: 768px) {
    .button-group {
        gap: 6px;
    }
    
    .button-group .btn {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .button-group {
        gap: 4px;
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 360px) {
    .button-group {
        gap: 3px;
    }
} 