/* ====================================
   VELORA BUTTON SYSTEM
   Compatible with Legacy & New Design System
   ==================================== */

/* Legacy button classes map to new design system */

/* Global Form Input Styles */
/* Legacy class - use .velora-input for new implementations */
/* See .velora-input in velora-unified-theme.css */
.form-input {
    background: var(--velora-glass-light, var(--card-bg)) !important;
    color: var(--velora-text-luminous, var(--text-primary)) !important;
    border: 2px solid var(--velora-glass-border, var(--border-color)) !important;
    border-radius: var(--velora-radius-md, 10px) !important;
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    min-height: 44px !important; /* WCAG touch target compliance */
    transition: all var(--velora-transition-normal, 0.3s ease) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    touch-action: manipulation; /* Prevents double-tap zoom on iOS */
    position: relative; /* For validation icon positioning */
}

.form-input::placeholder {
    color: var(--velora-text-whisper, var(--text-secondary)) !important;
    opacity: 0.8 !important; /* Increased opacity for better mobile contrast */
}

.form-input:focus {
    outline: none !important;
    border-color: var(--velora-mystic-violet, var(--cosmic-violet)) !important;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1) !important;
    outline-offset: 3px !important; /* Larger offset for better mobile visibility */
}

/* Form input wrapper for validation icons */
.form-input-wrapper {
    position: relative;
    width: 100%;
}

.form-input-with-icon {
    padding-right: 3rem !important;
}

/* Disabled state */
.form-input:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Readonly state */
.form-input[readonly] {
    background: var(--velora-bg-tertiary) !important;
    cursor: default !important;
}

/* Autofill styling */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--velora-bg-primary) inset !important;
    -webkit-text-fill-color: var(--velora-text-primary) !important;
    border-color: var(--velora-accent-primary) !important;
}

/* Mobile breakpoint enhancements */
@media (max-width: 768px) {
    .form-input {
        padding: 1.125rem 1.5rem !important;
        font-size: 1.0625rem !important; /* 17px prevents iOS zoom */
    }
}

@media (max-width: 640px) {
    .form-input {
        padding: 1rem 1.25rem !important;
    }
}

/* ====================================
   COZY COSMIC BUTTON SYSTEM
   Design System 2.0 - Standardized Buttons
   ==================================== */

/* Base Button Class */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    border-radius: 999px; /* Pills */
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    text-decoration: none;
    font-family: var(--font-sans, 'Source Sans 3', system-ui, sans-serif);
}

/* Primary Button - Full gradient with glow */
.button-primary,
.btn-primary {
    background: linear-gradient(135deg, var(--primary-600, #5b3fd9), var(--primary-500, #7b5cff));
    color: #fff;
    box-shadow: 0 10px 30px rgba(91, 63, 217, 0.4);
}

.button-primary:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(91, 63, 217, 0.5);
}

/* Secondary Button - Outline style */
.button-secondary,
.btn-secondary {
    background: var(--bg-surface, #ffffff);
    color: var(--primary-600, #5b3fd9);
    border-color: rgba(91, 63, 217, 0.35);
    border-width: 1px;
    border-style: solid;
}

.button-secondary:hover,
.btn-secondary:hover {
    background: var(--primary-100, #ebe4ff);
}

/* Tertiary Button - Text link with arrow (for future use) */
.button-tertiary {
    background: transparent;
    color: var(--primary-600, #5b3fd9);
    padding: 0.5rem 0.75rem;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.button-tertiary:hover {
    color: var(--primary-500, #7b5cff);
    text-decoration: none;
}

/* Button Size Variants */
.button-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.875rem;
}

.button-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* Button States */
.button:disabled,
.button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.button:focus-visible {
    outline: 2px solid var(--primary-500, #7b5cff);
    outline-offset: 2px;
}

/* ====================================
   LEGACY BUTTON MAPPINGS
   Maps existing button classes to new system
   ==================================== */

/* Global Button Styles - Maps to Velora Design System */

/* Base Button Class */
.velora-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    position: relative;
    overflow: hidden;
}

/* Primary buttons - use new design system classes when possible */
/* Extends .velora-btn base class */
.btn-primary,
a.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary {
    background: var(--velora-gradient-mystic, linear-gradient(135deg, #6C63FF, #9333EA)) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--velora-radius-lg, 12px) !important;
    padding: 0.875rem 2rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all var(--velora-transition-normal, 0.3s cubic-bezier(0.4, 0, 0.2, 1)) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: var(--velora-shadow-medium, 0 4px 15px rgba(108, 99, 255, 0.25)), var(--velora-glow-mystic, 0 0 20px rgba(107, 70, 193, 0.4)) !important;
    text-align: center !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--velora-shadow-strong, 0 6px 25px rgba(108, 99, 255, 0.35)), 0 0 30px rgba(107, 70, 193, 0.6) !important;
    filter: brightness(1.05) !important;
}

/* Secondary buttons - maps to celestial gradient */
/* Extends .velora-btn base class */
.btn-secondary,
a.btn-secondary {
    background: var(--velora-gradient-celestial, linear-gradient(135deg, #667eea, #764ba2)) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--velora-radius-lg, 12px) !important;
    padding: 0.875rem 2rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all var(--velora-transition-normal, 0.3s ease) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    box-shadow: var(--velora-shadow-medium, 0 4px 15px rgba(102, 126, 234, 0.25)), var(--velora-glow-celestial, 0 0 20px rgba(74, 95, 191, 0.4)) !important;
}

.btn-secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--velora-shadow-strong, 0 6px 25px rgba(102, 126, 234, 0.35)), 0 0 30px rgba(74, 95, 191, 0.6) !important;
}

/* Large buttons */
.btn-large {
    padding: 16px 40px !important;
    font-size: 1.125rem !important;
}

/* Navigation buttons */
.btn-nav,
a.btn-nav {
    background: linear-gradient(135deg, #6C63FF, #9333EA) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    box-shadow: 0 3px 10px rgba(108, 99, 255, 0.2) !important;
    font-size: 0.95rem !important;
}

.btn-nav:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3) !important;
}

/* Outline buttons - Maps to button-secondary */
/* Extends .velora-btn base class */
.btn-outline {
    background: var(--bg-surface, #ffffff) !important;
    border: 1px solid rgba(91, 63, 217, 0.35) !important;
    color: var(--primary-600, #5b3fd9) !important;
    border-radius: 999px !important; /* Pills */
    padding: 0.75rem 1.6rem !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    position: relative !important;
}

.btn-outline:hover {
    background: var(--primary-100, #ebe4ff) !important;
    transform: translateY(-1px) !important;
}

/* Ghost Button Variant */
.velora-btn-ghost {
    background: transparent;
    color: var(--velora-text-primary);
    border: none;
}

.velora-btn-ghost:hover {
    background: var(--velora-bg-hover);
}

/* Legacy ghost button class - maps to .velora-btn-ghost */
button.btn-ghost,
a.btn-ghost,
.btn-ghost {
    background: transparent;
    color: var(--velora-text-primary);
    border: none;
}

button.btn-ghost:hover,
a.btn-ghost:hover,
.btn-ghost:hover {
    background: var(--velora-bg-hover);
}

/* Button Size Variants */
.velora-btn-sm {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
}

.velora-btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.velora-btn-xl {
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
}

.velora-btn-block {
    width: 100%;
}

/* Button State Classes */
.velora-btn:disabled,
.velora-btn-loading,
.btn-loading {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Form submit buttons */
button[type="submit"],
input[type="submit"],
.btn[type="submit"] {
    background: linear-gradient(135deg, #6C63FF, #9333EA) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.25) !important;
}

button[type="submit"]:hover,
input[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 25px rgba(108, 99, 255, 0.35) !important;
    filter: brightness(1.1) !important;
}

/* Icon buttons */
.btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-icon i {
    font-size: 1.1em !important;
}

/* Button groups */
.btn-group {
    display: flex !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
}

/* Card buttons (inside cards) */
.card .btn,
.zodiac-card .btn,
.calculator-card .btn {
    width: 100% !important;
    margin-top: auto !important;
}

/* Social buttons */
.btn-social {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background: white !important;
    color: #333 !important;
    border: 2px solid #e0e0e0 !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
}

.btn-social:hover {
    background: #f8f9fa !important;
    border-color: #6C63FF !important;
    transform: translateY(-2px) !important;
}

/* Dark mode adjustments */
[data-theme="dark"] .btn-social {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .btn-social:hover {
    background: #334155 !important;
    border-color: #9333EA !important;
}

[data-theme="dark"] .velora-btn-ghost:hover {
    background: var(--velora-bg-hover);
}

/* Disabled state */
.btn:disabled,
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn:disabled:hover,
button:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.25) !important;
}

/* Loading state - supports both .btn-loading and .velora-btn-loading */
.btn-loading,
.velora-btn-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none !important;
}

.btn-loading::after,
.velora-btn-loading::after {
    content: '' !important;
    position: absolute !important;
    width: 20px !important;
    height: 20px !important;
    top: 50% !important;
    left: 50% !important;
    margin-left: -10px !important;
    margin-top: -10px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: white !important;
    border-radius: 50% !important;
    animation: spinner 0.6s linear infinite !important;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse animation for CTAs */
.btn-pulse {
    animation: pulse-shadow 2s infinite;
}

@keyframes pulse-shadow {
    0% {
        box-shadow: 0 4px 15px rgba(108, 99, 255, 0.25);
    }
    50% {
        box-shadow: 0 4px 25px rgba(108, 99, 255, 0.45);
    }
    100% {
        box-shadow: 0 4px 15px rgba(108, 99, 255, 0.25);
    }
}

/* Quick action buttons */
.btn-quick {
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
}

/* Floating action button */
.fab {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #6C63FF, #9333EA) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
}

.fab:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.4) !important;
}

.fab i {
    font-size: 1.5rem !important;
}