/* =================================================================
   responsive-components.css - MOBILE-FIRST RESPONSIVE UTILITIES & COMPONENTS
   ================================================================= */

/* RESPONSIVE GRID - Mobile first */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid--auto-fit {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid--auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid--auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.grid--2col {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid--2col {
        grid-template-columns: repeat(2, 1fr);
    }
}

.grid--3col {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid--3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid--3col {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* FLEXBOX HELPERS */
.flex {
    display: flex;
}

.flex--between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex--center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex--wrap {
    flex-wrap: wrap;
}

/* CARD COMPONENT - Responsive */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-dark);
}

.card--compact {
    padding: var(--spacing-sm);
}

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

/* BUTTON RESPONSIVE */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn--primary {
    background: var(--color-primary);
    color: white;
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: var(--color-secondary);
    color: white;
}

.btn--secondary:hover {
    background: #4338ca;
}

.btn--outline {
    background: transparent;
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

.btn--outline:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn--sm {
    padding: 0.35rem 0.7rem;
    font-size: var(--font-size-sm);
}

.btn--lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-lg);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* BADGE/LABEL */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    background: var(--color-bg-main);
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge--success {
    background: #d1fae5;
    color: #065f46;
}

.badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge--info {
    background: #dbeafe;
    color: #1e40af;
}

/* CONTAINER */
.container {
    max-width: 100%;
    padding: var(--spacing-md);
    margin: 0 auto;
}

@media (min-width: 640px) {
    .container {
        padding: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: var(--spacing-xl);
    }
}

/* INPUT/FORM ELEMENTS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast);
    background: var(--color-bg-card);
    color: var(--color-text-dark);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.1);
}

/* TYPOGRAPHY RESPONSIVE */
.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-base {
    font-size: var(--font-size-base);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.text-2xl {
    font-size: var(--font-size-2xl);
}

.text-3xl {
    font-size: var(--font-size-3xl);
}

.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

/* RESPONSIVE TEXT SIZING */
h1 {
    font-size: var(--font-size-2xl);
    margin: var(--spacing-md) 0;
}

@media (min-width: 768px) {
    h1 {
        font-size: var(--font-size-3xl);
    }
}

h2 {
    font-size: var(--font-size-xl);
    margin: var(--spacing-md) 0;
}

@media (min-width: 768px) {
    h2 {
        font-size: var(--font-size-2xl);
    }
}

h3 {
    font-size: var(--font-size-lg);
    margin: var(--spacing-sm) 0;
}

h4,
h5,
h6 {
    font-size: var(--font-size-base);
    margin: var(--spacing-sm) 0;
}

/* LAYOUT STACK - Mobile first vertical */
.stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.stack--sm {
    gap: var(--spacing-sm);
}

.stack--lg {
    gap: var(--spacing-lg);
}

.stack--xl {
    gap: var(--spacing-xl);
}

/* RESPONSIVE DISPLAY HELPERS */
.hidden-mobile {
    display: none;
}

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

.hidden-desktop {
    display: block;
}

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

/* SCROLL BEHAVIOR */
.scrollable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* OVERFLOW HANDLING */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ASPECT RATIO BOXES */
.aspect-square {
    aspect-ratio: 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

/* PRINT STYLES */
@media print {
    .no-print {
        display: none;
    }

    .print-only {
        display: block !important;
    }

    body {
        background: white;
    }
}