/* ==========================================================================
   RESPONSIVE COMPONENTS - TradeSignals
   Mobile-First Button & Card System
   ========================================================================== */

/* ==========================================================================
   RESPONSIVE BUTTON SYSTEM
   ========================================================================== */

/* Base Button - Mobile First */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-fluid-xs);
    padding: var(--spacing-fluid-sm) var(--spacing-fluid-md);
    font-size: var(--text-fluid-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-smooth);
    min-height: 44px; /* Touch-friendly */
    min-width: 44px;  /* Touch-friendly */
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Button Sizes - Responsive */
.btn-xs {
    padding: var(--spacing-fluid-xs) var(--spacing-fluid-sm);
    font-size: var(--text-fluid-xs);
    min-height: 36px;
    min-width: 36px;
}

.btn-sm {
    padding: var(--spacing-fluid-xs) var(--spacing-fluid-md);
    font-size: var(--text-fluid-xs);
    min-height: 40px;
    min-width: 40px;
}

.btn-md {
    padding: var(--spacing-fluid-sm) var(--spacing-fluid-lg);
    font-size: var(--text-fluid-sm);
    min-height: 44px;
    min-width: 44px;
}

.btn-lg {
    padding: var(--spacing-fluid-md) var(--spacing-fluid-xl);
    font-size: var(--text-fluid-base);
    min-height: 48px;
    min-width: 48px;
}

.btn-xl {
    padding: var(--spacing-fluid-lg) var(--spacing-fluid-2xl);
    font-size: var(--text-fluid-lg);
    min-height: 52px;
    min-width: 52px;
}

/* Button Variants */
.btn-primary {
    background: var(--primary, #0B2578);
    color: var(--text-white, #FFFFFF);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-hover, #1A9464);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary, #1A9464);
    color: var(--text-white, #FFFFFF);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--secondary-hover, #0B2578);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary, #0B2578);
    border: 2px solid var(--primary, #0B2578);
}

.btn-outline:hover {
    background: var(--primary, #0B2578);
    color: var(--text-white, #FFFFFF);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary, #111827);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
}

.btn-ghost:hover {
    background: var(--bg-gray-50, #FFFFFF);
    border-color: var(--border-dark, rgba(0, 0, 0, 0.08));
    transform: translateY(-1px);
}

/* Full Width Buttons - Mobile */
.btn-full {
    width: 100%;
    justify-content: center;
}

@media (min-width: 768px) {
    .btn-full {
        width: auto;
    }
    
    .btn-full-mobile {
        width: 100%;
    }
}

/* ==========================================================================
   RESPONSIVE CARD SYSTEM
   ========================================================================== */

/* Base Card - Mobile First */
.card {
    background: var(--bg-white, #FFFFFF);
    border-radius: var(--radius-lg);
    padding: var(--spacing-fluid-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    transition: all var(--transition-smooth);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Card Sizes */
.card-sm {
    padding: var(--spacing-fluid-md);
}

.card-lg {
    padding: var(--spacing-fluid-xl);
}

.card-xl {
    padding: var(--spacing-fluid-2xl);
}

/* Card Variants */
.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.card-glass {
    background: var(--glass-bg, rgba(255, 255, 255, 0.78));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
}

.card-bordered {
    border: 2px solid var(--border-color, rgba(0, 0, 0, 0.06));
    box-shadow: none;
}

.card-elevated {
    box-shadow: var(--shadow-lg);
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   RESPONSIVE GRID CARDS
   ========================================================================== */

.card-grid {
    display: grid;
    gap: var(--spacing-fluid-lg);
    grid-template-columns: 1fr;
}

/* Two Column Grid */
.card-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

/* Three Column Grid */
.card-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

/* Four Column Grid */
.card-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

/* Responsive Grid Gaps */
@media (min-width: 480px) {
    .card-grid {
        gap: var(--spacing-fluid-xl);
    }
}

@media (min-width: 768px) {
    .card-grid {
        gap: var(--spacing-fluid-2xl);
    }
}

/* ==========================================================================
   RESPONSIVE FORM COMPONENTS
   ========================================================================== */

/* Form Container */
.form-container {
    width: 100%;
    max-width: 100%;
    padding: var(--spacing-fluid-lg);
    background: var(--bg-white, #FFFFFF);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .form-container {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .form-container {
        max-width: 520px;
    }
}

/* Form Groups */
.form-group {
    margin-bottom: var(--spacing-fluid-lg);
}

.form-group label {
    display: block;
    font-size: var(--text-fluid-sm);
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: var(--spacing-fluid-xs);
}

/* Form Inputs - Responsive */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-fluid-sm);
    font-size: var(--text-fluid-base);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    border-radius: var(--radius);
    background: var(--bg-white, #FFFFFF);
    color: var(--text-primary, #111827);
    transition: all var(--transition-fast);
    min-height: 44px;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary, #0B2578);
    box-shadow: var(--ring, 0 0 0 3px rgba(11, 37, 120, 0.12));
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ==========================================================================
   RESPONSIVE NAVIGATION COMPONENTS
   ========================================================================== */

/* Navigation Pills */
.nav-pills {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-fluid-sm);
    padding: var(--spacing-fluid-xs);
    background: var(--bg-gray-50, #FFFFFF);
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .nav-pills {
        flex-direction: row;
        align-items: center;
    }
}

.nav-pill {
    padding: var(--spacing-fluid-sm) var(--spacing-fluid-md);
    font-size: var(--text-fluid-sm);
    font-weight: 500;
    color: var(--text-secondary, #6B7280);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-pill:hover,
.nav-pill.active {
    background: var(--bg-white, #FFFFFF);
    color: var(--primary, #0B2578);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   RESPONSIVE UTILITY CLASSES
   ========================================================================== */

/* Aspect Ratio Containers */
.aspect-16-9 {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: var(--radius);
}

.aspect-1-1 {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: var(--radius);
}

.aspect-4-3 {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
    border-radius: var(--radius);
}

.aspect-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Spacing Utilities */
.space-y-1 > * + * { margin-top: var(--spacing-fluid-xs); }
.space-y-2 > * + * { margin-top: var(--spacing-fluid-sm); }
.space-y-3 > * + * { margin-top: var(--spacing-fluid-md); }
.space-y-4 > * + * { margin-top: var(--spacing-fluid-lg); }
.space-y-5 > * + * { margin-top: var(--spacing-fluid-xl); }

.space-x-1 > * + * { margin-left: var(--spacing-fluid-xs); }
.space-x-2 > * + * { margin-left: var(--spacing-fluid-sm); }
.space-x-3 > * + * { margin-left: var(--spacing-fluid-md); }
.space-x-4 > * + * { margin-left: var(--spacing-fluid-lg); }
.space-x-5 > * + * { margin-left: var(--spacing-fluid-xl); }

/* Responsive Display Utilities */
.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
    
    .visible-mobile {
        display: none;
    }
}

.visible-mobile {
    display: block;
}

@media (min-width: 768px) {
    .visible-mobile {
        display: none;
    }
}

/* ==========================================================================
   ACCESSIBILITY & PERFORMANCE
   ========================================================================== */

/* Focus States */
.btn:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.nav-pill:focus {
    outline: 2px solid var(--primary, #0B2578);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .card,
    .form-input,
    .form-select,
    .form-textarea,
    .nav-pill {
        transition: none;
    }
    
    .btn:hover,
    .card:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--text-primary, #111827);
    }
}
