/* ============================================
   BLUEDOTS TECHNOLOGIES - RESPONSIVE STYLES
   Mobile-First Approach
   ============================================ */

/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* ===== RESPONSIVE CONTAINERS ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* ===== RESPONSIVE TABLES ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive table {
    min-width: 600px;
    width: 100%;
}

/* Mobile table stacking */
@media (max-width: 767px) {
    .table-mobile-stack thead {
        display: none;
    }

    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }

    .table-mobile-stack tr {
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        padding: 0.75rem;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .table-mobile-stack td {
        text-align: left !important;
        padding: 0.5rem 0;
        position: relative;
        padding-left: 50%;
        border: none;
    }

    .table-mobile-stack td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        font-weight: 600;
        white-space: nowrap;
        color: #4b5563;
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .table-mobile-stack td:first-child {
        padding-top: 0;
    }

    .table-mobile-stack td:last-child {
        padding-bottom: 0;
    }
}

/* ===== RESPONSIVE FORMS ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    font-size: 16px;
    /* Prevents iOS zoom on focus */
}

@media (min-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 14px;
    }
}

/* ===== RESPONSIVE BUTTONS ===== */
button,
.btn,
a.btn {
    min-height: 44px;
    /* Touch-friendly */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {

    .btn-responsive,
    .button-responsive {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group-responsive>* {
        width: 100%;
    }
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hamburger menu icon */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Hide mobile menu completely on desktop */
@media (min-width: 768px) {

    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }

    .hamburger {
        display: none;
    }
}

/* ===== UTILITY CLASSES ===== */
.hide-mobile {
    display: none;
}

.hide-desktop {
    display: block;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: block;
    }

    .hide-desktop {
        display: none;
    }
}

/* ===== RESPONSIVE SPACING ===== */
.spacing-sm {
    padding: 0.5rem;
}

.spacing-md {
    padding: 1rem;
}

.spacing-lg {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .spacing-sm {
        padding: 1rem;
    }

    .spacing-md {
        padding: 2rem;
    }

    .spacing-lg {
        padding: 3rem;
    }
}

/* ===== RESPONSIVE CARDS ===== */
.card-responsive {
    padding: 1rem;
}

@media (min-width: 768px) {
    .card-responsive {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .card-responsive {
        padding: 2rem;
    }
}

/* ===== TOUCH-FRIENDLY ELEMENTS ===== */
a,
button,
input,
select {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Larger click targets on mobile */
@media (max-width: 767px) {

    a.action-link,
    button.action-button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

/* ===== RESPONSIVE TEXT ===== */
.text-responsive-sm {
    font-size: 0.875rem;
}

.text-responsive-base {
    font-size: 1rem;
}

.text-responsive-lg {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
}

.text-responsive-xl {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.text-responsive-2xl {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.text-responsive-3xl {
    font-size: clamp(1.875rem, 5vw, 3rem);
}

/* ===== MOBILE-FRIENDLY ACTIONS ===== */
@media (max-width: 767px) {
    .action-buttons-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .action-buttons-mobile>* {
        width: 100%;
    }
}

/* ===== OVERFLOW PREVENTION ===== */
img {
    max-width: 100%;
    height: auto;
}

table {
    table-layout: auto;
}

/* ===== PRINT STYLES ===== */
@media print {

    .no-print,
    .mobile-menu,
    .mobile-menu-overlay,
    .hamburger {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .hide-mobile {
        display: block !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== FOCUS STYLES ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0076BE;
    outline-offset: 2px;
}