/* 1. Global Variables & Modern Reset */
:root {
    --primary-color: #ff4757; /* Matches your header pink */
    --secondary: #9c27b0;
    --accent: #ff4081;
    --bg-light: #f0f2f5;
    --text-dark: #2f3542;
    --text-muted: #65676b;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden; /* Critical to prevent horizontal shaking on mobile */
}

/* MODERN LIVING BACKGROUND INTEGRATION */
body {
    font-family: 'Inter', -apple-system, sans-serif;
    /* Living Gradient Colors: Soft Romance -> Blush -> Purity */
    background: linear-gradient(-45deg, #fff0f1, #fff, #ffe4e6, #fff5f6);
    background-size: 400% 400%;
    animation: loveFlow 15s ease infinite;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 5px; /* Adds breathing room below the sticky header */
    min-height: 100vh;
}

@keyframes loveFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Optional: Subtle texture overlay for high-end feel */
body::before {
    content: "";
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-image: radial-gradient(#ff4757 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.05; /* Keep it barely visible */
    pointer-events: none;
    z-index: -1;
}

/* 2. Responsive Layout Containers */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

.dashboard-wrapper {
    display: flex; /* Switched from Grid to Flex for better auto-adjustment */
    flex-wrap: wrap; 
    gap: 20px;
    margin-top: 20px;
    padding-bottom: 80px; /* Space for mobile nav */
}

/* Define Pane Widths for Desktop */
.left-pane { flex: 0 0 25%; max-width: 25%; }
.center-pane { flex: 1; min-width: 300px; }
.right-pane { flex: 0 0 25%; max-width: 25%; }

/* 3. Reusable Components */
.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    word-wrap: break-word;
    overflow: hidden; /* Keeps content inside the card */
}

.btn-main {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary));
    color: #ffffff !important;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

/* 4. Form Adjustments */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #dddfe2;
    border-radius: 10px;
    font-size: 16px; /* Essential: Prevents iOS auto-zoom on focus */
    background: #fff;
    font-family: inherit;
    transition: border 0.2s;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* 5. Mobile Gallery Fix */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.gallery-img { 
    width: 100%; 
    aspect-ratio: 1/1; /* Keeps images perfectly square */
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

/* 6. THE BIG MOBILE RE-TUNE */

/* Small Desktop/Tablets */
@media (max-width: 1024px) {
    .left-pane { flex: 0 0 30%; max-width: 30%; }
    .center-pane { flex: 0 0 65%; max-width: 65%; }
    .right-pane { display: none; } /* Hide right side on tablets */
}

/* Phones */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column; /* Stack vertically */
        margin-top: 10px;
    }

    .left-pane, .center-pane, .right-pane {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 10px;
    }

    .main-wrapper {
        padding: 0 10px;
    }

    /* Auto-adjusting grids for mobile */
    .info-grid {
        display: grid;
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 5px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 per row on small screens */
    }

    /* Message Bubble Mobile Scaling */
    .msg-bubble {
        max-width: 90% !important;
        font-size: 13px;
    }
}

/* 7. Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.9em; }
.mt-10 { margin-top: 10px; }
.photo-blurred { filter: blur(15px); pointer-events: none; user-select: none; }
.badge-count { background: red; color: white; padding: 2px 6px; border-radius: 10px; font-size: 11px; }