﻿/* ============================================
   ORJICLOUD - Unified Button Styles
   Glassmorphism Design System
   ============================================
   
   Usage:
   - .btn                  : Base button class (required)
   - .btn-primary          : Primary action (blue glass)
   - .btn-secondary        : Secondary/cancel action (outline)
   - .btn-success          : Success/confirm action (green glass)
   - .btn-danger           : Destructive action (red glass)
   - .btn-warning          : Warning action (yellow/orange glass)
   - .btn-ghost            : Minimal/text-only style
   
   Sizes:
   - .btn-sm               : Small button
   - .btn-lg               : Large button
   
   Modifiers:
   - .btn-block            : Full width button
   - .btn-icon             : Icon-only button (square)
   - .btn-loading          : Loading state with spinner
   
   ============================================ */

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn:focus {
    outline: none;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn i,
.btn svg {
    font-size: 0.9em;
    flex-shrink: 0;
}

/* ============================================
   PRIMARY BUTTON - Main actions (Blue Glass)
   ============================================ */
.btn-primary {
    background: rgba(59, 130, 246, 0.85);
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.95);
    border-color: rgba(96, 165, 250, 0.6);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* ============================================
   SECONDARY BUTTON - Cancel, back, neutral (Glass Outline)
   ============================================ */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Light theme variant */
.btn-secondary-light {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

.btn-secondary-light:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.9);
    transform: translateY(-1px);
}

/* ============================================
   SUCCESS BUTTON - Confirm, complete, save (Green Glass)
   ============================================ */
.btn-success {
    background: rgba(16, 185, 129, 0.85);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.95);
    border-color: rgba(52, 211, 153, 0.6);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* ============================================
   DANGER BUTTON - Delete, remove, destructive (Red Glass)
   ============================================ */
.btn-danger {
    background: rgba(220, 38, 38, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.95);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* Outline variant for less emphasis */
.btn-danger-outline {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #EF4444;
}

.btn-danger-outline:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.7);
    color: #EF4444;
    transform: translateY(-1px);
}

/* ============================================
   WARNING BUTTON - Caution actions (Orange Glass)
   ============================================ */
.btn-warning {
    background: rgba(217, 119, 6, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-warning:hover:not(:disabled) {
    background: rgba(217, 119, 6, 0.95);
    border-color: rgba(245, 158, 11, 0.6);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ============================================
   GHOST BUTTON - Minimal, text-like
   ============================================ */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0.75rem;
    backdrop-filter: none;
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Light theme variant */
.btn-ghost-light {
    background: transparent;
    border-color: transparent;
    color: rgba(0, 0, 0, 0.6);
    backdrop-filter: none;
}

.btn-ghost-light:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.9);
}

/* ============================================
   SIZE VARIANTS
   ============================================ */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 10px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 14px;
}

/* ============================================
   MODIFIERS
   ============================================ */

/* Full width */
.btn-block {
    width: 100%;
}

/* Icon only (square button) */
.btn-icon {
    padding: 0.75rem;
    aspect-ratio: 1;
}

.btn-icon.btn-sm {
    padding: 0.5rem;
}

.btn-icon.btn-lg {
    padding: 1rem;
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   BUTTON GROUPS
   ============================================ */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 12px 0 0 12px;
}

.btn-group .btn:last-child {
    border-radius: 0 12px 12px 0;
}

.btn-group .btn:not(:last-child) {
    border-right-color: rgba(255, 255, 255, 0.1);
}

/* Button row with gap */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-row-center {
    justify-content: center;
}

.btn-row-end {
    justify-content: flex-end;
}

.btn-row-between {
    justify-content: space-between;
}

/* ============================================
   SPECIAL VARIANTS
   ============================================ */

/* Link style button */
.btn-link {
    background: transparent;
    border: none;
    color: #60A5FA;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    backdrop-filter: none;
}

.btn-link:hover:not(:disabled) {
    color: #3B82F6;
    text-decoration: underline;
}

/* Glass Primary - More transparent version */
.btn-glass-primary {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60A5FA;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-glass-primary:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93C5FD;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Glass Success */
.btn-glass-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-glass-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.35);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6EE7B7;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Glass Danger */
.btn-glass-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-glass-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.5);
    color: #FCA5A5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Glass Neutral - For dark backgrounds */
.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-glass:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-row {
        flex-direction: column;
    }
    
    .btn-row .btn {
        width: 100%;
    }
    
    .btn-row-responsive {
        flex-direction: column;
    }
}
