/* the jon sheet Styles */

:root {
    --bg-color: #fdfaf6;
    /* Warm paper tone */
    --text-color: #333;
    --primary-color: #2980b9;
    --hover-color: #3498db;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #2c3e50;
    /* Dark background */
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* =========================================
   Admin Bar (admin.html)
   ========================================= */
.admin-bar {
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
    flex-shrink: 0;
    min-height: 60px;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Admin Link Style */
.admin-bar a {
    text-decoration: none;
    color: white;
    background: var(--primary-color);
    /* Make it look like a button */
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.admin-bar a:hover {
    background: var(--hover-color);
}

/* =========================================
   Floating UI Controls
   ========================================= */

/* 1. Jump to Sheet Button (Top Right) */
.floating-jump-btn {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.floating-jump-btn:hover {
    transform: translateY(-2px);
    background: var(--hover-color);
}

/* Floating Edit Button (Top Left) */
.floating-edit-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #e74c3c;
    /* Red to signify action */
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}

.floating-edit-btn:hover {
    transform: translateY(-2px);
    background: #c0392b;
}

.floating-edit-btn.active {
    background: #27ae60;
    /* Green when active */
}

/* Mode Indicator (Top Center) */
.mode-text {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    /* No Background */
    background: transparent;
    color: black;
    /* Plain black text */
    padding: 5px 15px;
    font-size: 1rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
    /* text-transform: uppercase; Removed */
    letter-spacing: 1px;
    font-family: 'Courier New', Courier, monospace;
    /* Typewriter font */
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
    /* Contrast against image if needed */
}



/* =========================================
   Sheet Area
   ========================================= */
.scroll-container {
    width: 100%;
    flex: 1;
    /* Fills remaining vertical space */
    overflow: auto;
    position: relative;
    cursor: grab;
    background: #000;
    /* Center the content via child margin: auto */
    display: flex;
}

.scroll-container:active,
.scroll-container.active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

/* Wrapper for Image + Overlay */
.sheet-wrapper {
    position: relative;
    display: block;
    /* Flex item behavior */
    width: 100%;
    /* Default: Fit Screen */
    flex-shrink: 0;
    /* Prevent shrinking below set width */
    max-width: none;
    transition: width 0.1s ease-out;
    /* Smooth Zoom */
    margin: auto;
    /* SAFELY centers content vertically and horizontally */
}

.sheet-bg {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    opacity: 0.9;
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    /* Grid columns handled by JS/Inline styles */
}


/* Utilities */
.hidden {
    display: none !important;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 80%;
}

.modal-content p {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.modal-content .subtext {
    font-size: 1.5rem;
    /* Larger warning */
    font-weight: bold;
    color: #c0392b;
    /* Warning Red */
    margin-bottom: 25px;
}

.modal-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.modal-content button:hover {
    transform: scale(1.05);
}

/* =========================================
   Google Sign-In UI
   ========================================= */

/* Startup Loading Screen */
.startup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6000;
}

/* Sign-In Overlay (notebook paper look) */
.sign-in-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e8e0d4;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.sign-in-paper {
    background: #fdfaf5;
    width: 90%;
    max-width: 480px;
    min-height: 500px;
    padding: 60px 50px;
    position: relative;
    box-shadow: 2px 3px 15px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0,0,0,0.1);
    /* Lined paper effect */
    background-image:
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            #c8dae8 31px,
            #c8dae8 32px
        );
    background-position: 0 40px;
    /* Slight rotation for hand-placed feel */
    transform: rotate(-1.5deg);
}

/* Red margin line */
.sign-in-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 70px;
    width: 2px;
    height: 100%;
    background: #e4a0a0;
    opacity: 0.6;
}

/* Torn top edge */
.sign-in-paper::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 8px;
    background: #fdfaf5;
    filter: url(#torn-edge);
    mask-image: url("data:image/svg+xml,%3Csvg width='400' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,4 Q10,0 20,4 T40,4 T60,4 T80,4 T100,4 T120,4 T140,4 T160,4 T180,4 T200,4 T220,4 T240,4 T260,4 T280,4 T300,4 T320,4 T340,4 T360,4 T380,4 T400,4' fill='white'/%3E%3C/svg%3E");
    mask-size: 400px 8px;
}

.sign-in-content {
    text-align: left;
    color: #2c3e50;
    position: relative;
    padding-left: 30px;
}

.sign-in-content h1 {
    font-family: 'Homemade Apple', 'Segoe Script', cursive;
    font-size: 3.5rem;
    margin-bottom: 4px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.title-logo {
    display: inline-block;
    vertical-align: bottom;
    height: 1.4em;
    width: auto;
    margin-left: -0.6em;
    margin-bottom: -0.3em;
}

.sign-in-note {
    font-family: 'Homemade Apple', 'Segoe Script', cursive;
    font-size: 1.4rem;
    color: #999;
    display: block;
    margin-top: 20px;
}

.homies-list {
    font-family: 'Homemade Apple', 'Segoe Script', cursive;
    font-size: 1rem;
    color: #c0392b;
    margin-top: 40px;
    line-height: 2;
    text-align: left;
}

.homies-list .homies-label {
    color: #c0392b;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.homies-list ul {
    list-style: disc;
    padding-left: 24px;
    margin: 6px 0 0 0;
}

.homies-list li {
    margin-bottom: 2px;
}

.sign-in-btn {
    background: none;
    color: #2980b9;
    padding: 12px 28px;
    border-radius: 6px;
    border: 2px solid #2980b9;
    font-family: 'Homemade Apple', 'Segoe Script', cursive;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    display: inline-block;
    margin-top: 30px;
}

.sign-in-btn:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}


/* Top Right Controls */
.top-right-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    z-index: 1000;
}

.floating-user-info {
    color: #ccc;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sign-out-link {
    color: #aaa;
    text-decoration: underline;
    font-size: 0.85rem;
}

.sign-out-link:hover {
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 7000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: white;
    margin-top: 16px;
    font-size: 1.2rem;
}

/* Mobile */
@media (max-width: 600px) {
    .floating-edit-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
        top: 8px;
        left: 8px;
    }

    .mode-text {
        display: none;
    }

    .top-right-controls {
        top: 8px;
        right: 8px;
        gap: 8px;
    }

    .floating-jump-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .floating-user-info {
        position: fixed;
        bottom: 10px;
        right: 10px;
        top: auto;
    }

    .sign-out-link {
        font-size: 0.7rem;
    }

    .sign-in-content h1 {
        white-space: normal;
    }

    .title-logo {
        float: right;
    }
}

/* Error Toast (above sign-in overlay so it shows on auth failure) */
.error-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    z-index: 7500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}