/* GLANCE Mobile - Base Styles */

/* Import Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    /* Default theme colors - will be overridden by company config */
    --primary-color: #FF6B35;
    --secondary-color: #1E1E1E;
    --accent-color: #00D084;
    --background-color: #2A2A2A;
    --text-color: #FFFFFF;
    --error-color: #FF4444;
    --warning-color: #FFA500;
    --success-color: #00D084;

    /* Layout */
    --header-height: 60px;
    --content-padding: 20px;
    --button-height: 48px;
    --input-height: 48px;
    --border-radius: 12px;
}

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

/* Base */
html, body {
    height: 100%;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Only */
body {
    max-width: 428px; /* iPhone 13 Pro Max width */
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Container */
.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 428px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.header-time {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
}

/* Content */
.content {
    flex: 1;
    padding: calc(var(--header-height) + var(--content-padding)) var(--content-padding) 100px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #1a1a1a;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    padding: var(--content-padding);
}

.company-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 40px;
}

.login-form {
    width: 100%;
    max-width: 320px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.9;
}

.form-input {
    width: 100%;
    height: var(--input-height);
    padding: 0 16px;
    font-size: 16px;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
    width: 100%;
    height: var(--button-height);
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    background: var(--primary-color);
    border: none !important;
    outline: none !important;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: none !important;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--primary-color);
    border: none;
    outline: none;
    color: var(--text-color);
    box-shadow: none;
}

.btn-small {
    height: 36px;
    font-size: 14px;
    padding: 0 16px;
}

/* Device Selection */
.device-selector {
    margin-bottom: 30px;
}

.mac-display {
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 20px;
}

.mac-address {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: var(--accent-color);
}

/* Selection Grid */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.selection-item {
    /* aspect-ratio: 1; */
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 05px;
    text-align: center;
    position: relative;
    transform: scale(0.95);
}

.selection-item.selected {
    border-color: var(--accent-color);
    background-color: rgba(0, 208, 132, 0.1);
    transform: scale(1.0);
}

.selection-item:hover {
    transform: scale(1.0);
    border-color: var(--primary-color);
}

.selection-item img {
    width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}

.selection-item-name {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.9;
}

/* Add Button */
.add-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #00a86b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 30px;
    right: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 208, 132, 0.3);
    transition: all 0.3s ease;
}

.add-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 208, 132, 0.4);
}

.add-button::before {
    content: '+';
    font-size: 36px;
    color: white;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 24px;
    width: 90%;
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.modal-close:hover {
    opacity: 1;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background-color: rgba(0, 208, 132, 0.1);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.color-input {
    flex: 1;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Hamburger Menu */
.header-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
}

.hamburger {
    width: 28px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Side Menu - Slides from Right */
.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    background-color: var(--secondary-color);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    padding: 80px 24px 24px 24px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.side-menu.active {
    right: 0;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.menu-overlay.active {
    display: block;
}

.menu-item {
    display: block;
    padding: 14px 18px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    font-size: 15px;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

.menu-button {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

/* Status Messages */
.status-message {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 99;
    max-width: 388px; /* Account for margins */
    margin: 0 auto;
}

.status-success {
    background-color: rgba(0, 208, 132, 0.2);
    color: var(--success-color);
}

.status-error {
    background-color: rgba(255, 68, 68, 0.2);
    color: var(--error-color);
}

.status-warning {
    background-color: rgba(255, 165, 0, 0.2);
    color: var(--warning-color);
}

/* Professional polish and animations */
.now-live-widget, .selection-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.selection-item:active {
    transform: scale(0.98);
}

.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.98);
}

/* Back button styling */
.back-button-container a:hover {
    opacity: 1;
}

.back-button-container a:active {
    transform: translateX(-2px);
}

/* Responsive adjustments for smaller phones */
@media (max-width: 375px) {
    .selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-title {
        font-size: 16px;
    }

    .side-menu {
        width: 90vw;
        max-width: 280px;
    }
}

/* Dark Mode Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.3);
}