/* ============================================================
   BASE STYLES
   ============================================================ */
body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    background-color: #0f1629;
    color: #e0e0e0;
}

#root {
    height: 100%;
}

/* ============================================================
   WELCOME PAGE
   ============================================================ */
.welcome-page,
.login-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f1629 0%, #1a237e 50%, #283593 100%);
    position: relative;
    overflow: hidden;
}

/* Animated background shapes */
.welcome-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    animation: float 12s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #536DFE;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #FF4081;
    bottom: -80px;
    left: -80px;
    animation-delay: 4s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #00BCD4;
    top: 50%;
    left: 50%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.welcome-card,
.login-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.6s ease-out;
}

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

.welcome-icon,
.login-icon {
    font-size: 56px;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.welcome-card h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-welcome-enter {
    background: linear-gradient(135deg, #536DFE, #3F51B5);
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(83, 109, 254, 0.4);
}

.btn-welcome-enter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(83, 109, 254, 0.6);
}

.btn-welcome-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 12px 30px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-welcome-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.welcome-footer {
    margin-top: 30px;
}

.link-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.link-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-card {
    max-width: 400px;
    padding: 40px 35px;
}

.login-card h2 {
    margin: 0 0 25px;
    font-size: 24px;
    color: white;
    font-weight: 600;
}

.btn-back {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-back:hover {
    color: white;
}

.login-page .form-group {
    text-align: left;
    margin-bottom: 18px;
}

.login-page .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.login-page .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.login-page .form-group input:focus {
    outline: none;
    border-color: #536DFE;
    background: rgba(255, 255, 255, 0.12);
}

.login-page .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-error {
    background: rgba(229, 57, 53, 0.2);
    border: 1px solid rgba(229, 57, 53, 0.4);
    color: #ff8a80;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #536DFE, #3F51B5);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(83, 109, 254, 0.3);
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(83, 109, 254, 0.5);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   EDITOR: APP CONTAINER
   ============================================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f5f5f5;
    color: #333;
}

.header {
    background: linear-gradient(135deg, #1a237e, #283593);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.tour-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tour-selector select {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.tour-selector select option {
    color: #333;
    background: white;
}

.btn-save,
.btn-upload {
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: inline-block;
    transition: all 0.2s;
}

.btn-save {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.4);
}

.btn-upload {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.btn-upload:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.4);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.user-badge {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
}

.btn-admin {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-admin:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-logout {
    background: rgba(229, 57, 53, 0.2);
    color: #ff8a80;
    border: 1px solid rgba(229, 57, 53, 0.3);
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(229, 57, 53, 0.35);
    color: white;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    padding: 15px;
    margin: 0;
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    font-weight: 600;
    color: #1a237e;
}

.scene-item {
    padding: 13px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.scene-item:hover,
.scene-item.active {
    background-color: #e8eaf6;
    border-left: 4px solid #3f51b5;
}

.instructions {
    margin-top: auto;
    padding: 16px;
    font-size: 13px;
    color: #666;
    background-color: #fff9c4;
    border-top: 1px solid #ddd;
}

/* Tour management in sidebar (superuser) */
.tour-management {
    border-top: 2px solid #e8eaf6;
    padding: 10px 0;
}

.tour-management h4 {
    margin: 0;
    padding: 5px 15px 8px;
    font-size: 12px;
    color: #1a237e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tour-mgmt-item {
    display: flex;
    align-items: center;
    padding: 6px 15px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.tour-mgmt-item:hover {
    background-color: #fff3e0;
}

.tour-mgmt-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

/* Hotspot list in sidebar */
.hotspot-list {
    border-top: 1px solid #ddd;
    padding: 10px 0;
}

.hotspot-list h4 {
    margin: 0;
    padding: 5px 15px 8px;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotspot-list-item {
    display: flex;
    align-items: center;
    padding: 6px 15px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.hotspot-list-item:hover {
    background-color: #f5f5f5;
}

.hotspot-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.hotspot-badge.youtube { background-color: #F44336; }
.hotspot-badge.document { background-color: #4CAF50; }
.hotspot-badge.link { background-color: #2196F3; }
.hotspot-badge.info { background-color: #FF9800; }

.hotspot-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hotspot-delete-btn {
    background: none;
    border: none;
    color: #e53935;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.hotspot-delete-btn:hover {
    opacity: 1;
    background-color: #ffebee;
}

/* ============================================================
   VIEWER
   ============================================================ */
.viewer-container {
    flex: 1;
    position: relative;
    background-color: #000;
}

#pano {
    width: 100%;
    height: 100%;
    position: absolute;
}

.overlay-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   MODALS (shared)
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 440px;
    max-width: 92%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    color: #333;
    animation: slideUp 0.3s ease-out;
}

.modal-content h3 {
    margin-top: 0;
    font-size: 20px;
    color: #1a237e;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #536DFE;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions button {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-actions button:first-child {
    background-color: #e0e0e0;
    color: #333;
}

.modal-actions button:first-child:hover {
    background-color: #bdbdbd;
}

.modal-actions .btn-primary,
.btn-primary {
    background: linear-gradient(135deg, #536DFE, #3F51B5);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(83, 109, 254, 0.4);
}

/* ============================================================
   PRIVACY MODAL
   ============================================================ */
.privacy-modal {
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
}

.privacy-text {
    text-align: left;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.privacy-text h4 {
    color: #1a237e;
    margin: 20px 0 8px;
    font-size: 15px;
}

.privacy-text ul {
    padding-left: 20px;
}

.privacy-text li {
    margin-bottom: 6px;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.admin-header h3 {
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #333;
}

.admin-message {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    background: #e8eaf6;
    color: #1a237e;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover td {
    background: #f5f5f5;
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.superuser {
    background: #fff3e0;
    color: #e65100;
}

.role-badge.editor {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-small {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s;
}

.btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-edit:hover {
    background: #bbdefb;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #ffcdd2;
}

.admin-form {
    margin-top: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.admin-form h4 {
    margin: 0 0 15px;
    color: #1a237e;
}

/* ============================================================
   EDITOR HOTSPOTS (visual indicators)
   ============================================================ */
.editor-hotspot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.editor-hotspot:hover {
    transform: scale(1.2);
}

.editor-hotspot.youtube { background-color: #F44336; }
.editor-hotspot.document { background-color: #4CAF50; }
.editor-hotspot.link { background-color: #2196F3; }
.editor-hotspot.info { background-color: #FF9800; }

.hotspot-tooltip {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.editor-hotspot:hover .hotspot-tooltip {
    display: block;
}