/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f9fafb;
}

/* Form Elements */
.modal-body label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-body textarea {
    min-height: 200px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    resize: vertical;
}

/* Specific styling for layout description textarea */
.modal-body textarea#layoutDescription {
    font-family: inherit;
    min-height: 80px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.modal-body textarea#layoutDescription:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Layouts List */
.layouts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.layout-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    overflow: hidden;
}

.layout-item-preview {
    flex-shrink: 0;
    width: 120px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-item-content {
    padding: 12px;
    flex-grow: 1;
}

.layout-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.layout-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.layout-item-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.layout-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
}

.layout-item-description {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
    font-style: italic;
}

.layout-item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.layout-item-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
}

/* Export Modal */
.export-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.export-info p {
    margin-bottom: 0.5rem;
    color: #1e40af;
}

.export-info p:last-child {
    margin-bottom: 0;
}

.export-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    min-width: 300px;
    border-left: 4px solid #3b82f6;
    animation: toastSlideIn 0.3s ease;
    position: relative;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.toast.success .toast-icon {
    background: #10b981;
}

.toast.error .toast-icon {
    background: #ef4444;
}

.toast.warning .toast-icon {
    background: #f59e0b;
}

.toast.info .toast-icon {
    background: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: #374151;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #374151;
}

/* Loading States */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.invisible {
    visibility: hidden;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Icon Styles */
.telemetry-icon,
.widget-icon {
    display: inline-block;
    margin-right: 0.25rem;
    font-size: 1em;
    vertical-align: middle;
}

.telemetry-icon {
    margin-right: 0.5rem;
}

.widget-icon {
    margin-right: 0.3rem;
}

/* Telemetry Item Styling */
.telemetry-item-name {
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* Widget Icon in Canvas */
.widget .widget-icon {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Device Selector Section */
.device-selector-section {
    margin-bottom: 1.5rem;
}

.device-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 4px;
}

.device-selector-title h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

/* Compact Layout Controls */
.layout-controls-compact {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    min-width: auto;
}

.btn-icon-label:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon-label:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-icon-part {
    font-size: 14px;
    line-height: 1;
}

.btn-label-part {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Color variations for different actions */
.btn-icon-label#newLayoutBtn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-icon-label#saveLayoutBtn:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

.btn-icon-label#loadLayoutBtn:hover {
    border-color: #6b7280;
    background: #f9fafb;
    color: #374151;
}

.btn-icon-label#exportLayoutBtn:hover {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #d97706;
}

/* Keep the old btn-icon styles for backward compatibility */
.btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    font-size: 14px;
}

.btn-icon:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Tooltip for icon buttons (still works for labeled buttons) */
.btn-icon::before,
.btn-icon-label::before {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.btn-icon:hover::before,
.btn-icon-label:hover::before {
    opacity: 1;
}

/* Device selector adjustments - moved to main section above */

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

/* Device Info Display - Compact */
.device-info {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.device-info.hidden {
    display: none;
}

.device-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-image {
    width: 60px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    display: block;
}

.device-image::before {
    content: "📱";
    display: block;
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 40px;
    font-size: 1.5rem;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.device-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-description {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.spec-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.spec-value {
    color: var(--text-primary);
    font-weight: 400;
}

.device-features {
    margin-top: 0.25rem;
}

.features-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.1rem;
    display: none; /* Hide to save space */
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
}

.feature-tag {
    display: inline-block;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .device-info {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.25rem;
    }
    
    .device-image {
        width: 50px;
        height: 35px;
        margin: 0 auto;
    }
    
    .device-name {
        font-size: 0.8rem;
    }
    
    .device-description {
        font-size: 0.65rem;
    }
    
    .spec-item {
        font-size: 0.65rem;
    }
    
    .features-list {
        justify-content: center;
    }
    
    .feature-tag {
        font-size: 0.55rem;
    }
    
    .device-selector-wrapper {
        padding: 0.4rem;
    }
    
    .device-select {
        padding: 0.3rem;
        font-size: 0.75rem;
    }
}

/* Canvas Container Responsive */
.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 320px;
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.canvas-container #canvas {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Device Info Overlay - Top Left */
.device-info-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px;
    color: white;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.device-name-large {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ff6b35;
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-name-large::before {
    content: "📟";
    font-size: 18px;
}

.device-properties {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-prop {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.device-prop i {
    width: 14px;
    font-size: 11px;
    color: #ff6b35;
}

/* Zoom Controls Overlay - Top Right */
.zoom-controls-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zoom-controls-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-actions {
    display: flex;
    gap: 4px;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.zoom-btn:hover {
    background: rgba(255, 107, 53, 0.3);
    border-color: #ff6b35;
    transform: translateY(-1px);
}

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

.zoom-display {
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    background: rgba(255, 107, 53, 0.2);
    border-radius: 4px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

/* Zoom button specific styles */
.zoom-out:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.zoom-in:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
}

.zoom-fit:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.zoom-reset:hover {
    background: rgba(168, 85, 247, 0.3);
    border-color: #a855f7;
}

/* Responsive adjustments for overlays */
@media (max-width: 768px) {
    .device-info-overlay,
    .zoom-controls-overlay {
        position: static;
        margin-bottom: 12px;
        background: rgba(0, 0, 0, 0.6);
    }
    
    .canvas-container {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    
    .device-info-overlay {
        order: 1;
    }
    
    .zoom-controls-overlay {
        order: 2;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }
    
    .zoom-actions {
        margin-left: 12px;
    }
    
    #canvas {
        order: 3;
        margin-top: 12px;
    }
}

/* Badge Styles */
.public-badge {
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.author-badge {
    background: #6b7280;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

/* User Layout Sidebar Items */
.user-layout-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    background: white;
    transition: all 0.2s ease;
}

.user-layout-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.user-layout-item .layout-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 12px;
    margin-bottom: 4px;
}

.user-layout-item .layout-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.user-layout-item .widget-count {
    color: #6b7280;
    font-size: 10px;
}

.user-layout-item .public-indicator {
    background: #10b981;
    color: white;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
}

.user-layout-item .layout-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.user-layout-item .layout-actions button {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.user-layout-item .layout-actions button:hover {
    background: #e5e7eb;
}

.user-layout-item .btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Tab Styles for Load Modal */
.layout-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #f8fafc;
}

/* Loading and Error States */
.loading-text, .no-layouts, .error-text {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    padding: 16px;
    font-style: italic;
}

.error-text {
    color: #dc2626;
}

/* Button Loading State */
.btn.loading {
    opacity: 0.7;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Checkbox Styling for Modals */
.checkbox-group .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
    margin: 0;
    font-weight: normal;
    line-height: 1.5;
}

.checkbox-group .checkbox-input {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px; /* Align with first line of text */
}

.checkbox-group .checkbox-text {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
}

.checkbox-group .checkbox-label:hover .checkbox-text {
    color: #1f2937;
}

.checkbox-group .checkbox-label:hover .checkbox-input {
    outline: 2px solid #bfdbfe;
    outline-offset: 1px;
}

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

/* Removed old layout controls section - replaced with compact icon buttons */

/* Update header to be more compact */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 60px;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.header-left .version {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Device selector adjustments - moved to main section above */

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

/* User Dropdown Styles for Tool/Landing Pages */
.header-right .user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.header-right .user-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-right .user-btn:hover {
    background: rgba(255,255,255,0.3);
}

.header-right .user-btn.active {
    background: rgba(255,255,255,0.35);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

.header-right .user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.1);
}

.header-right .user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-right .dropdown-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 12px 12px 0 0;
    color: white;
}

.header-right .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right .user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.header-right .user-details {
    flex: 1;
    min-width: 0;
}

.header-right .user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-right .user-email {
    font-size: 13px;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-right .dropdown-body {
    padding: 8px 0;
}

.header-right .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.header-right .dropdown-item:hover {
    background: #f8f9fa;
    color: #ff6b35;
}

.header-right .dropdown-item i {
    width: 16px;
    font-size: 14px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.header-right .dropdown-item:hover i {
    color: #ff6b35;
}

.header-right .dropdown-item span {
    font-size: 14px;
    font-weight: 500;
}

.header-right .dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 8px 0;
}

/* Dropdown arrow */
.header-right .user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

/* Pulse animation for device overlay updates */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
} 