/* --- 1. Global Styles & Variables --- */
:root {
    --sky-blue: #a7d1e3;
    --cloud-white: #f0f8ff;
    --dark-text: #333a45;
    --stone-grey: #e8e8e8;
    --accent-green: #5a8a6f;
    --font-headings: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    --border-radius-base: 8px;
    --spacing-unit: 20px;
}

body {
    font-family: var(--font-body);
    background-color: var(--sky-blue); /* The blue bg behind the sidebar */
    background-image: url('/images/backgrounds/your_tile.png');
    color: var(--dark-text);
    margin: 0;
    padding: 0;
    cursor: url('/images/cursors/main.cur'), auto;
}

a {
    color: var(--accent-green);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    color: var(--dark-text);
}

a,
button,
.btn,
input[type="submit"],
.nav-feather,
select {
    cursor: url('/images/cursors/pointer.cur'), pointer;
}

/* --- 2. Main Page Layout --- */
#page-container {
    display: flex;
    flex-direction: column; /* Stacks header, main, and footer vertically */
    min-height: 100vh;
    /* --- THIS IS THE FIX --- */
    /* Set a max-width (e.g., 1920px) to match your layout image */
    max-width: 1200px; 
    /* This centers the entire page container on the screen */
    margin: 0 auto; 
    /* This adds a nice shadow around your whole layout */
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

#main-content-area {
    display: flex; /* Makes sidebar and content sit side-by-side */
    flex-grow: 1; /* This makes this area fill all available space */
}

/* --- 3. Header --- */
#site-header {
    background-image: url('/images/layout/header_bg.jpg');
    background-size: auto;
    background-position: center;
    height: 322px; /* Adjust to the height of your header image */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-unit);
    border-bottom: 2px solid #000; /* Example border */
}

#header-left { flex: 1; }
#header-center { flex: 1; text-align: center; }
#header-right { flex: 1; text-align: right; }

#site-logo {
    position: relative;
    top: -5px;  /* Example: Move 5px down */
    left: 125px; /* Example: Move 10px to the right */
}

/* *** UPDATED: This now styles the link and the image *** */
#site-logo a {
    display: inline-block;
}
#site-logo img {
    height: 200px; /* Adjust this to fit your logo */
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.5)); /* Adds a subtle shadow */
}

#profile-picture-container {
    position: relative;
    top: -22px;
    left: 8px;
    display: inline-block; /* Added this to help with positioning */
}

#profile-picture-container img {
    width: 130px;
    height: 130px;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#player-info {
    position: relative;
    right: 79px; /* Example: Move 10px to the left (away from the edge) */
    top: -23px;   /* Example: Move 5px down */
    display: inline-block; /* Added this to help with positioning */

    background-color: rgba(0,0,0,0.3);
    color: white;
    padding: 20px;
    min-width: 320px; /* Added a minimum width */
    border-radius: var(--border-radius-base);
    font-weight: bold;
    text-align: left;
}
#player-info p {
    margin: 0 0 5px 0;
}

#player-info .currency {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Adds space between the seeds and dewdrops rows */
}

#player-info .currency-item {
    display: flex;
    align-items: center; /* Vertically centers the image and text */
    gap: 5px; /* Space between the image and the number */
}

#player-info .currency-item img {
    width: 16px;  /* Adjust size as needed */
    height: 16px;
}

/* --- Currency Display with Icon --- */
.currency-display {
    display: flex; /* Uses flexbox for alignment */
    align-items: center; /* Vertically centers content */
    gap: 5px; /* Space between the icon and the text */
    /* You might want to remove justify-content if it's inherited from a parent style */
    /* For example, if the parent is setting text-align: center, this will override it */
    justify-content: flex-start; /* Aligns content to the start by default */
}

.currency-display img {
    width: 16px; /* Adjust size as needed */
    height: 16px;
    vertical-align: middle; /* Ensures image aligns well with text baseline */
}

/* Optional: If you want prices in the shop to be centered, you can add this */
.site-shop .item-card .price {
    justify-content: center; /* This will center the currency-display itself */
}

/* --- 4. Sidebar Navigation --- */
#sidebar-nav {
    width: 190px; /* Adjust to the width of your nav image area */
    flex-shrink: 0; /* Prevents the nav from shrinking */
    padding: 20px 10px;
    background-color: #a7d1e3;
}

.nav-feather {
    display: block;
    width: 100%;
    height: 80px; /* Adjust to the height of your feather images */
    text-indent: -9999px; /* Hides the link text */
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}
.nav-feather:hover {
    transform: scale(1.05); /* Slight zoom on hover */
}


/* Assign each feather image to its link ID */
#feather-home { background-image: url('/images/layout/feather_home.png'); }
#feather-myflock { background-image: url('/images/layout/feather_myflocks.png'); }
#feather-afterlife { background-image: url('/images/layout/feather_afterlife.png'); }
#feather-cache { background-image: url('/images/layout/feather_cache.png'); }
#feather-community { background-image: url('/images/layout/feather_community.png'); }
#feather-games { background-image: url('/images/layout/feather_games.png'); }
#feather-notifications { background-image: url('/images/layout/feather_notifications.png'); }
#feather-profile { background-image: url('/images/layout/feather_profile.png'); }
#feather-settings { background-image: url('/images/layout/feather_settings.png'); }
#feather-shops { background-image: url('/images/layout/feather_shops.png'); }
#feather-activities { background-image: url('/images/layout/feather_activities.png'); }
/* ... Add all your other feather links here ... */
#feather-logout { background-image: url('/images/layout/feather_logout.png'); }
#feather-post-news { background-image: url('/images/layout/feather_admin.png'); }

/* --- 5. Main Content Wrapper --- */
#content-wrapper {
    flex-grow: 1; /* Makes the content fill the remaining space */
    background-color: #ffffff; /* The white content area */
    padding: var(--spacing-unit);
    overflow-y: auto; /* Adds a scrollbar if content is too tall */
    height: 1414px; /* Example fixed height, can be changed */
    border-left: 10px solid #000; /* Adds a solid black line on the left */
}

/* --- 6. Footer --- */
#site-footer {
    background-image: url('/images/layout/footer_bg.jpg');
    background-size: auto;
    background-position: center;
    height: 259px; /* Adjust to the height of your footer image */
    border-top: 2px solid #000;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

/* --- 7. Other Styles --- */
/* Add your message, form, and other helper styles back in */
.message { padding: 10px; margin-bottom: 15px; border-radius: 5px; font-weight: bold; }
.message.success { background-color: #d4edda; color: #155724; }
.message.error { background-color: #f8d7da; color: #721c24; }
.form-group { margin-bottom: 15px; }
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}
.btn:hover { background-color: var(--dark-text); }

/* --- 8. Hub Page Styles --- */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.hub-card {
    border: 1px solid var(--stone-grey);
    border-radius: var(--border-radius-base);
    background-color: #fcfcfc;
    text-align: center;
    text-decoration: none;
    color: var(--dark-text);
    transition: box-shadow 0.2s, transform 0.2s;
    display: block;
}
.hub-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}
.hub-card img {
    width: 200px;
    height: 200px;
    object-fit: auto;
    border-radius: 8px 8px 0 0;
    background-color: var(--stone-grey); /* Fallback color */
}
.hub-card h3 {
    margin: 10px 0 5px 0;
}
.hub-card p {
    font-size: 0.9em;
    color: #666;
    padding: 0 10px 10px 10px;
    margin: 0;
}
.hub-card.disabled {
    cursor: not-allowed;
}
.hub-card.disabled img {
    filter: grayscale(100%);
    opacity: 0.6;
}
/* ==== Notification feather & badge ==== */
.notif-wrapper {
    position: relative;
    display: block;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 16px;
    padding: 2px 5px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 0 0 2px #3a3731;
    animation: notifBadgePulse 1.4s ease-out infinite;
    pointer-events: none;
}

@keyframes notifBadgePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231,76,60,.6); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(231,76,60,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}


.notif-glow {
    animation: notifPulse 1.3s infinite ease-in-out;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.9));
}

@keyframes notifPulse {
    0% {
        filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 0, 0, 1));
    }
    100% {
        filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.8));
    }
}

.autocomplete-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 20;
    display: none;
    max-height: 220px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #e8f3ff;
}

.autocomplete-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.autocomplete-name {
    font-weight: bold;
}

.autocomplete-type {
    margin-left: auto;
    font-size: 0.8em;
    color: #777;
    font-style: italic;
}


