/* ================================================================================
   BUTTONS.CSS - Button System
   All button variants, sizes, and states
   ================================================================================ */

/* ================================
   BASE BUTTON
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-md);
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 48px;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ================================
   PRIMARY BUTTON
   ================================ */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* ================================
   SECONDARY BUTTON
   ================================ */
.btn-secondary {
    background: var(--bg-section);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-muted);
    border-color: var(--border-purple);
}

/* ================================
   OUTLINE BUTTON
   ================================ */
.btn-outline {
    background: transparent;
    color: var(--purple);
    border: 2px solid var(--purple);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-purple);
}

/* ================================
   GHOST BUTTON
   ================================ */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-section);
    color: var(--text-primary);
}

/* ================================
   TEXT BUTTON
   ================================ */
.btn-text {
    background: transparent;
    color: var(--text-link);
    border: none;
    padding: var(--space-sm);
    min-height: auto;
}

.btn-text:hover:not(:disabled) {
    text-decoration: underline;
}

/* ================================
   DANGER BUTTON
   ================================ */
.btn-danger {
    background: var(--error-gradient);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--bg-red);
}

/* ================================
   SUCCESS BUTTON
   ================================ */
.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--bg-green);
}

/* ================================
   WARNING BUTTON
   ================================ */
.btn-warning {
    background: var(--orange-gradient);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--bg-orange);
}

/* ================================
   LINK STYLE BUTTON
   ================================ */
.btn-link {
    background: none;
    border: none;
    color: var(--text-link);
    padding: 0;
    min-height: auto;
    text-decoration: none;
}

.btn-link:hover:not(:disabled) {
    color: var(--dark-blue);
    text-decoration: underline;
}

/* ================================
   BUTTON SIZES
   ================================ */
.btn-xs {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
    min-height: 32px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    min-height: 40px;
}

.btn-lg {
    padding: var(--space-xl) var(--space-2xl);
    font-size: var(--text-lg);
    min-height: 56px;
}

/* ================================
   BUTTON WIDTHS
   ================================ */
.btn-full {
    width: 100%;
}

.btn-auto {
    width: auto;
    flex: none;
}

/* ================================
   BUTTON GROUPS
   ================================ */
.btn-group {
    display: flex;
    gap: var(--space-sm);
}

.btn-group .btn {
    flex: 1;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.btn-group-vertical .btn {
    width: 100%;
}

/* ================================
   ICON BUTTONS
   ================================ */
.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-circle);
    min-height: auto;
}

.btn-icon.btn-sm {
    width: 40px;
    height: 40px;
}

.btn-icon.btn-lg {
    width: 56px;
    height: 56px;
}

/* ================================
   FLOATING ACTION BUTTON
   ================================ */
.fab,
.floating-action-button {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + var(--space-xl));
    right: var(--space-xl);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-circle);
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-fab);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.fab:hover,
.floating-action-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* ================================
   TOGGLE SWITCH
   ================================ */
.toggle-container {
    border-radius: var(--radius-xl);
    display: flex;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.toggle-track {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-option {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.toggle-option.active {
    color: var(--text-primary);
}

.toggle-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: white;
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    z-index: 1;
    transform: translateX(0);
    will-change: transform;
}

/* ================================
   GF STATUS INDICATORS
   ================================ */
.gf-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
}

.gf-indicator.always-tap-cask {
    background: var(--gold-gradient);
    color: var(--text-primary);
}

.gf-indicator.always-bottle-can {
    background: var(--success-gradient);
    color: white;
}

.gf-indicator.currently {
    background: var(--orange-gradient);
    color: white;
}

.gf-indicator.not-currently {
    background: var(--error-gradient);
    color: white;
}

.gf-indicator.unknown {
    background: var(--grey-gradient);
    color: white;
}

/* ================================
   iOS INPUT FIX (prevents zoom)
   ================================ */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
    }
    
    .search-input,
    .modal input,
    .form-control {
        font-size: 16px !important;
        line-height: 1.4;
        padding: 12px 16px;
    }
    
    #placesSearchInput {
        font-size: 16px !important;
    }
}