/**
 * Buttons - Premium Dugmad 2025
 */

/* ==========================================
   BASE BUTTON
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    /* iOS Safari fixes */
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ripple Effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ==========================================
   PRIMARY BUTTON - Always white text
   ========================================== */
.btn--primary {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.35);
}

.btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.45);
    color: #ffffff !important;
}

.btn--primary:active {
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* ==========================================
   SECONDARY BUTTON
   ========================================== */
.btn--secondary {
    background: var(--gradient-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.15);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================
   OUTLINE BUTTON - Readable on hover
   ========================================== */
.btn--outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn--outline:hover {
    background: var(--primary);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

/* ==========================================
   GHOST BUTTON
   ========================================== */
.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* ==========================================
   DANGER BUTTON
   ========================================== */
.btn--danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

.btn--danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.45);
    color: #ffffff !important;
}

/* ==========================================
   SUCCESS BUTTON
   ========================================== */
.btn--success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.35);
}

.btn--success:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(34, 197, 94, 0.45);
    color: #ffffff !important;
}

/* ==========================================
   BUTTON SIZES
   ========================================== */
.btn--sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

.btn--lg {
    padding: 18px 36px;
    font-size: 1.125rem;
}

.btn--xl {
    padding: 22px 48px;
    font-size: 1.25rem;
}

.btn--block {
    width: 100%;
}

/* ==========================================
   ICON BUTTON
   ========================================== */
.btn--icon {
    padding: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.btn--icon.btn--sm {
    width: 40px;
    height: 40px;
    padding: 10px;
}

.btn--icon.btn--lg {
    width: 56px;
    height: 56px;
    padding: 14px;
}

/* ==========================================
   ADDON SELECT BUTTON (za kartice)
   ========================================== */
.btn--addon-select {
    background: var(--gradient-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: space-between;
}

.btn--addon-select:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 107, 53, 0.05) 100%);
}

.btn--addon-select i {
    transition: transform 0.3s ease;
}

.btn--addon-select.is-expanded i {
    transform: rotate(180deg);
}

/* ==========================================
   LOADING STATE
   ========================================== */
.btn--loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn--loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* ==========================================
   RESPONSIVE BUTTONS
   ========================================== */
@media (max-width: 768px) {
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        gap: 8px;
        min-height: 44px;
    }
    
    .btn--sm {
        padding: 8px 14px;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .btn--lg {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .btn--xl {
        padding: 16px 32px;
        font-size: 1.05rem;
    }
    
    .btn--icon {
        width: 44px;
        height: 44px;
        padding: 10px;
    }
    
    .btn--icon.btn--sm {
        width: 36px;
        height: 36px;
    }
    
    .btn--icon.btn--lg {
        width: 50px;
        height: 50px;
    }
    
    /* Remove transform on hover for mobile */
    .btn--primary:hover,
    .btn--secondary:hover,
    .btn--outline:hover,
    .btn--danger:hover,
    .btn--success:hover {
        transform: none;
    }
    
    /* Center icons in buttons */
    .btn i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .btn--lg {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}
