/* ================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ================================ */

/* Root Variables */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-dark: #1a202c;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition-base: all 0.3s ease;
    --border-radius: 0.5rem;
    --max-width-container: 1200px;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Container Responsive */
.container, .container-lg {
    width: 100%;
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container, .container-lg {
        padding: 0 2rem;
    }
}

/* Grid System Enhancement */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.row > * {
    padding: 0 0.5rem;
}

@media (min-width: 768px) {
    .row {
        margin: 0 -1rem;
    }
    .row > * {
        padding: 0 1rem;
    }
}

/* Card Components */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-base);
    height: 100%;
}

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

/* Post Card Images - Fixed Size */
.card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Featured Post Image */
.featured-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center;
}

/* Post Image Wrapper - Maintains Aspect Ratio */
.post-image-wrapper,
.liked-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.post-image,
.liked-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.post-image-wrapper:hover .post-image,
.liked-image-wrapper:hover .liked-image {
    transform: scale(1.05);
}

/* Post Overlay */
.post-overlay,
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-image-wrapper:hover .post-overlay,
.liked-image-wrapper:hover .image-overlay {
    opacity: 1;
}

@media (min-width: 768px) {
    .card-img-top,
    .post-image-wrapper,
    .liked-image-wrapper {
        height: 250px;
    }

    .featured-image {
        height: 400px;
    }
}

@media (min-width: 992px) {
    .card-img-top,
    .post-image-wrapper,
    .liked-image-wrapper {
        height: 280px;
    }
}

.card-body {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-fluid {
    width: 100%;
    height: auto;
}

/* Spacing Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

@media (max-width: 767.98px) {
    .p-md-5 { padding: 1.5rem !important; }
    .p-md-4 { padding: 1rem !important; }
    .mt-5 { margin-top: 2rem; }
    .mb-5 { margin-bottom: 2rem; }
}

/* Text Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-dark { color: var(--text-dark); }

/* Code Blocks */
pre {
    padding: 1rem;
    background-color: #1a202c;
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
}

@media (max-width: 767.98px) {
    pre {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.bg-primary {
    background-color: var(--primary-color) !important;
    color: white;
}

.bg-info {
    background-color: #17a2b8 !important;
    color: white;
}

/* Shadows */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Responsive Display */
@media (max-width: 767.98px) {
    .d-md-none {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .d-md-block {
        display: block !important;
    }
}

/* Forms */
.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
}

/* Rounded Utilities */
.rounded {
    border-radius: var(--border-radius) !important;
}

.rounded-pill {
    border-radius: 50rem !important;
}

/* Flex Utilities */
.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Target Optimization */
@media (max-width: 767.98px) {
    .btn, a.nav-link, button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn {
        display: none !important;
    }
}
