:root {
    /* SANDSIV Brand Color Variables */
    --primary-color: #BF2025; /* red "sandsiv+" */
    --secondary-color: #4F4F4F; /* dark gray */
    --accent-color: #F42C04; /* bright red */
    --light-accent: #EC604E; /* light red */
    --weak-yellow: #FCECC9; /* weak yellow */
    --light-color: #ffffff; /* white */
    --dark-color: #000000; /* black */
    --light-gray: #C6C6C6; /* light gray */
    --success-color: #2ecc71;
    --warning-color: #F42C04; /* now using bright red from secondary palette */
    --error-color: #BF2025; /* now using red from primary palette */
    
    /* Layout Variables */
    --sidebar-width: 70px;
    --topbar-height: 60px;
    --border-radius: 4px;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: var(--topbar-height) 1fr auto;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas: 
        "header header"
        "sidebar main"
        "footer footer";
}

/* Top Bar */
.top-bar {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-color); /* changed to white */
    color: var(--dark-color); /* changed to black */
    padding: 0 20px;
    box-shadow: var(--box-shadow);
    z-index: 100;
    border-bottom: 1px solid var(--light-gray);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 35px;
    margin-right: 10px;
}

.prototype-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--dark-color); /* changed to black */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

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

.user-info {
    font-size: 0.9rem;
    margin-right: 10px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--accent-color);
}

.settings-btn {
    background-color: transparent;
    color: var(--secondary-color);
    padding: 0;
}

.settings-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.login-btn, .logout-btn {
    background-color: transparent;
    color: var(--secondary-color);
    padding: 0;
}

.login-btn:hover, .logout-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background-color: var(--light-color); /* changed to white */
    padding: 15px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px; /* increased spacing between icons to match icon height */
    border-right: 1px solid var(--light-gray);
}

.prototype-icon {
    width: 50px;
    height: 50px;
    border-radius: 0; /* changed to square */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--weak-yellow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.prototype-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.prototype-icon.active {
    border: 3px solid var(--primary-color);
}

.prototype-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

/* Main Content */
.main-content {
    grid-area: main;
    overflow: hidden;
    position: relative;
    background-color: var(--light-color); /* changed to white */
}

.default-content {
    padding: 30px;
    height: 100%;
    overflow-y: auto;
}

.prototype-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Prototype Description Area */
.prototype-description-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #f9f9f9;
    border-bottom: 1px solid var(--light-gray);
    padding: 15px 20px;
    max-height: 40%;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.prototype-description-area .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    color: var(--secondary-color);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.prototype-description-area .close-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.description-content {
    padding-right: 30px;
}

/* Markdown styles for description content */
.description-content h1,
.description-content h2,
.description-content h3 {
    margin-top: 0.8em;
    margin-bottom: 0.5em;
    color: var(--secondary-color);
}

.description-content h1 {
    font-size: 1.5rem;
}

.description-content h2 {
    font-size: 1.3rem;
}

.description-content h3 {
    font-size: 1.1rem;
}

.description-content p {
    margin-bottom: 0.8em;
}

.description-content ul,
.description-content ol {
    margin-left: 1.5em;
    margin-bottom: 0.8em;
}

.description-content code {
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.description-content pre {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 0.8em;
}

.description-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.description-content a:hover {
    text-decoration: underline;
}

.description-content blockquote {
    border-left: 4px solid var(--light-accent);
    padding-left: 15px;
    margin-left: 0;
    color: var(--secondary-color);
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 10px;
    font-size: 14px;
    color: var(--dark-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Notification */
.error-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    max-width: 300px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Icon styling for user controls */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-color);
    font-size: 1.2rem;
    padding: 5px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Custom quote styling */
.quote-container {
    background-color: rgba(252, 236, 201, 0.7); /* weak-yellow with transparency */
    padding: 15px 20px;
    border-left: 5px solid var(--primary-color);
    margin: 20px 0;
}

.quote-text {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--secondary-color);
}

.quote-author {
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: right;
    color: var(--dark-color);
}

/* Access Control Table */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.wildcard-info {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.wildcard-info p {
    margin: 0;
    line-height: 1.5;
}

.wildcard-info code {
    background-color: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.access-table {
    width: 100%;
    border-collapse: collapse;
}

.access-email-input {
    flex-grow: 1;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

.access-email-input.error {
    border-color: var(--error-color);
    background-color: rgba(231, 76, 60, 0.05);
}

.remove-user-btn {
    background-color: var(--error-color);
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Footer */
.footer {
    grid-area: footer;
    background-color: var(--light-color);
    color: var(--secondary-color);
    padding: 10px 20px;
    font-size: 0.8rem;
    border-top: 1px solid var(--light-gray);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 15px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Login Popup */
.login-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.login-popup-content {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-popup-content h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.login-popup-content p {
    margin-bottom: 25px;
    color: var(--secondary-color);
}

.login-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.primary-btn:hover {
    background-color: var(--accent-color);
}

.secondary-btn {
    background-color: transparent;
    color: var(--secondary-color);
    padding: 12px 20px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: #f5f5f5;
    border-color: var(--secondary-color);
} 