/* ========================================
   RESPONSIVE UTILITIES & BREAKPOINTS
   Mobile-First Approach for All Pages
   ======================================== */

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    font-size: clamp(14px, 2.5vw, 16px);
}

/* ========================================
   FLUID TYPOGRAPHY
   Scales responsively across all devices
   ======================================== */
h1 { font-size: clamp(1.75rem, 8vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 6vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 5vw, 2.2rem); }
h4 { font-size: clamp(1.1rem, 4vw, 1.8rem); }
h5 { font-size: clamp(1rem, 3.5vw, 1.5rem); }
h6 { font-size: clamp(0.9rem, 3vw, 1.2rem); }

p {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
}

/* ========================================
   CONTAINERS & GRID
   ======================================== */
.container {
    width: 100%;
    padding: clamp(1rem, 5vw, 2rem);
    margin: 0 auto;
    max-width: 1400px;
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 900px;
}

.container-lg {
    max-width: 1200px;
}

.container-xl {
    max-width: 1400px;
}

.grid {
    display: grid;
    gap: clamp(1rem, 4vw, 2rem);
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ========================================
   FLEXBOX UTILITIES
   ======================================== */
.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-col {
    flex-direction: column;
}

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

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ========================================
   PADDING & MARGIN UTILITIES
   ======================================== */
.p-0 { padding: 0; }
.p-1 { padding: clamp(0.5rem, 1vw, 0.75rem); }
.p-2 { padding: clamp(1rem, 2vw, 1.5rem); }
.p-3 { padding: clamp(1.5rem, 3vw, 2rem); }
.p-4 { padding: clamp(2rem, 4vw, 2.5rem); }

.m-0 { margin: 0; }
.m-1 { margin: clamp(0.5rem, 1vw, 0.75rem); }
.m-2 { margin: clamp(1rem, 2vw, 1.5rem); }
.m-3 { margin: clamp(1.5rem, 3vw, 2rem); }
.m-4 { margin: clamp(2rem, 4vw, 2.5rem); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* ========================================
   RESPONSIVE BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.7rem, 2vw, 1rem) clamp(1.2rem, 3vw, 1.5rem);
    border: none;
    border-radius: 0.5rem;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #D4A574 0%, #c29860 100%);
    color: #1a1a1a;
}

.btn-primary:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(212, 165, 116, 0.3);
    }
}

/* ========================================
   RESPONSIVE INPUT FIELDS
   ======================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: clamp(0.7rem, 2vw, 1rem);
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    border: 2px solid rgba(212, 165, 116, 0.2);
    border-radius: 0.75rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    color: #000;
    min-height: 44px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #D4A574;
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.1);
}

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

/* ========================================
   RESPONSIVE TABLES
   ======================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.75rem, 2vw, 0.95rem);
}

th, td {
    padding: clamp(0.75rem, 2vw, 1rem);
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: rgba(212, 165, 116, 0.1);
    font-weight: 600;
}

tr:hover {
    background: rgba(212, 165, 116, 0.05);
}

/* ========================================
   RESPONSIVE IMAGES & MEDIA
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

video,
iframe {
    max-width: 100%;
    height: auto;
}

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

.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-auto {
    aspect-ratio: auto;
}

/* ========================================
   RESPONSIVE CARDS
   ======================================== */
.card {
    background: #fff;
    border-radius: 1rem;
    padding: clamp(1.2rem, 3vw, 1.5rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.card-body {
    margin-bottom: 1rem;
}

.card-footer {
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* ========================================
   VISIBILITY & DISPLAY
   ======================================== */
.hidden { display: none !important; }
.visible { display: block !important; }
.invisible { visibility: hidden; }

/* Mobile-First Show/Hide */
.show-mobile { display: block; }
.show-tablet { display: none; }
.show-desktop { display: none; }

@media (min-width: 481px) {
    .show-mobile { display: none; }
    .show-tablet { display: block; }
}

@media (min-width: 769px) {
    .show-tablet { display: none; }
    .show-desktop { display: block; }
}

/* ========================================
   TEXT UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-bold { font-weight: 700; }
.text-semibold { font-weight: 600; }
.text-medium { font-weight: 500; }
.text-normal { font-weight: 400; }
.text-light { font-weight: 300; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-break {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========================================
   COLORS & BACKGROUNDS
   ======================================== */
.text-primary { color: #D4A574; }
.text-secondary { color: #a8a8a8; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-info { color: #17a2b8; }

.bg-primary { background: #D4A574; }
.bg-secondary { background: #f8f9fa; }
.bg-light { background: #f8f9fa; }
.bg-dark { background: #1a1a1a; }

/* ========================================
   SHADOWS & EFFECTS
   ======================================== */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.shadow-lg {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.shadow-xl {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   OPACITY UTILITIES
   ======================================== */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ========================================
   ROUNDED UTILITIES
   ======================================== */
.rounded-sm { border-radius: 0.25rem; }
.rounded { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.75rem; }
.rounded-lg { border-radius: 1rem; }
.rounded-xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* ========================================
   RESPONSIVE BREAKPOINTS
   Mobile-First Design
   ======================================== */

/* Extra Small (320px - 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 1rem;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 0.5rem;
    }
}

/* Small (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium (769px - 1024px) */
@media (min-width: 769px) {
    .container {
        padding: 1rem;
    }

    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large (1025px - 1440px) */
@media (min-width: 1025px) {
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra Large (1441px+) */
@media (min-width: 1441px) {
    body {
        font-size: 16px;
    }

    .container {
        max-width: 100%;
        padding: 1rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none !important;
    }

    .btn,
    button,
    input[type="button"],
    input[type="submit"] {
        display: none !important;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    img {
        max-width: 100%;
    }

    table {
        border-collapse: collapse;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible for Keyboard Navigation */
:focus-visible {
    outline: 2px solid #D4A574;
    outline-offset: 2px;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

.slide-down {
    animation: slideDown 0.3s ease;
}

/* ========================================
   TOUCH OPTIMIZATION
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    button,
    a,
    input[type="button"],
    input[type="submit"] {
        min-height: 48px;
        font-size: 16px;
    }

    .btn {
        min-height: 48px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px;
        min-height: 48px;
    }
}


