/* =========================================
   1. FONTS & BASE STYLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

body {
    background-color: #f8fafc;
    /* Light Mode Gradient */
    background-image: radial-gradient(at 0% 0%, hsla(156,70%,96%,1) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, hsla(156,70%,96%,1) 0, transparent 50%), 
                      radial-gradient(at 100% 0%, hsla(156,70%,96%,1) 0, transparent 50%);
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease;
}

/* Dark Mode Background Override */
.dark body {
    background-color: #0f172a; /* Slate 900 */
    background-image: radial-gradient(at 0% 0%, rgba(6, 78, 59, 0.3) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, rgba(6, 78, 59, 0.2) 0, transparent 50%);
}

/* Lock body scrolling when Modal/Sidebar is open */
body.modal-open {
    overflow: hidden;
}

/* =========================================
   2. ANIMATIONS
   ========================================= */
@keyframes fade-in-up { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.animate-enter { 
    animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
    opacity: 0; 
}

@keyframes pulse-ring { 
    0% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 
    100% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } 
}

/* =========================================
   3. COMPONENTS (GLASS & CARDS)
   ========================================= */
.glass-panel { 
    background: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.6); 
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

.dark .glass-panel { 
    background: rgba(30, 41, 59, 0.8); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
}

.icon-card { 
    background: linear-gradient(145deg, #ffffff, #f0fdf4);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.dark .icon-card { 
    background: linear-gradient(145deg, #1e293b, #0f172a); 
    border-color: #334155; 
}

.icon-card:hover { 
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #34d399;
}

/* =========================================
   4. MODAL LOGIC & STRUCTURE
   ========================================= */
#profile-modal, #contact-modal, #review-modal, #match-modal { 
    transition: opacity 0.3s ease-in-out; 
}

.hidden-modal { 
    opacity: 0; 
    pointer-events: none; 
}

.visible-modal { 
    opacity: 1; 
    pointer-events: auto; 
}

/* Modal Content Container */
.modal-content { 
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* 90dvh fixes address bar hiding issues on mobile */
    height: 90dvh; 
    max-height: 850px;
    display: flex;
    flex-direction: column;
}

/* Content Scaling Animation */
.hidden-modal .modal-content { transform: scale(0.95); }
.visible-modal .modal-content { transform: scale(1); }

/* Scrollable Area inside Modal */
.modal-body { 
    overflow-y: auto; 
    flex-grow: 1; 
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* Scrollbar Styling for Modal */
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }
.dark .modal-body::-webkit-scrollbar-thumb { background-color: #475569; }

/* =========================================
   5. SIDEBAR & NAVIGATION
   ========================================= */
#sidebar { 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 50;
}

/* =========================================
   6. FORM ELEMENTS & STATUS
   ========================================= */
.status-dot { 
    width: 8px; height: 8px; background-color: #10b981; border-radius: 50%; display: inline-block; position: relative; 
}
.status-dot::after { 
    content: ''; position: absolute; width: 100%; height: 100%; top: 0; left: 0; 
    background-color: #10b981; border-radius: 50%; z-index: -1; 
    animation: pulse-ring 2s infinite; 
}

.custom-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* =========================================
   7. NEW FEATURES (Images & Stars)
   ========================================= */

/* Review Star Rating */
#star-container i {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.1s, color 0.2s;
}
#star-container i:hover {
    transform: scale(1.1);
}

/* Trade Card Image Container */
.trade-image-container {
    width: 100%;
    height: 180px;
    background-color: #f3f4f6;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dark .trade-image-container {
    background-color: #1e293b;
}