/* --- Basic Reset & Global Styles --- */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #2c2c2c;
    color: #f0f0f0;
    overflow: hidden; /* Prevent body scrollbars, we scroll internally */
}

.hidden {
    display: none !important;
}

/* --- Main Application Layout --- */
#app-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Main content iframe takes up the rest of the space */
iframe[name="content-frame"] {
    /* Permanent margin for the first, non-overlay sidebar panel (100px wide) */
    margin-left: 100px; 
    width: calc(100% - 100px);

    flex-grow: 1;
    height: 100%;
    border: none;
    background-color: #333;
    display: block; /* Removes potential inline-block spacing issues */
}

/* --- Global UI Components --- */

/* 1. Total Star Count Display */
#star-counter-display {
    position: fixed;
    bottom: 15px;
    right: 15px;
    
    /* Polish: Glassmorphism look */
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(4px);
    color: #f0f0f0;
    padding: 8px 16px;
    border-radius: 30px;
    
    /* Polish: Gold border to match the star */
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 1000;
    user-select: none;
    transition: transform 0.2s;
}

#star-counter-display:hover {
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 0.6);
}

#star-counter-display svg {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    color: #FFD700; /* Gold */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* 2. Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px; /* Moved down slightly for better visibility */
    left: 0;
    width: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    pointer-events: none; /* Allow clicks to pass through the container */
}

@keyframes toast-in-out {
    0% { transform: translateY(-20px) scale(0.9); opacity: 0; }
    10% { transform: translateY(0) scale(1); opacity: 1; }
    90% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(0.9); opacity: 0; }
}

.toast-message {
    pointer-events: auto; /* Re-enable clicks on the toast itself */
    padding: 12px 30px;
    border-radius: 50px; /* Pill shape */
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    animation: toast-in-out 4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background-color: #007acc; /* Default Info Blue */
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-message.info {
    background: linear-gradient(135deg, #007acc, #005a99);
}

.toast-message.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.toast-message.success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}