/* Loom-style CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

/* Main Container */
.recorder-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

/* Header */
.recorder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.recorder-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: #625df5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-avatar:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Recording Widget */
.recording-widget {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Mode Selection */
.mode-selection h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 32px;
    color: #1a1a1a;
}

.recording-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.mode-card {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mode-card:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.mode-card.active {
    background: #625df5;
    color: white;
    border-color: #625df5;
    box-shadow: 0 8px 25px rgba(98, 93, 245, 0.3);
}

.mode-icon {
    font-size: 32px;
    margin-bottom: 12px;
    position: relative;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-card[data-mode="camera_and_screen"] .mode-icon {
    position: relative;
}

.screen-icon {
    font-size: 32px;
}

.camera-bubble {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #625df5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    border: 2px solid white;
}

.mode-card.active .camera-bubble {
    background: white;
    color: #625df5;
}

.mode-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mode-card p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Start Recording Button */
.start-recording-btn {
    background: #625df5;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(98, 93, 245, 0.3);
}

.start-recording-btn:hover {
    background: #5a54e8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(98, 93, 245, 0.4);
}

.start-recording-btn i {
    color: #ff4757;
    font-size: 12px;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ff4757;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

.red-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.control-buttons {
    display: flex;
    gap: 16px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.pause-btn {
    background: #ffa502;
    color: white;
}

.pause-btn:hover {
    background: #ff9500;
}

.resume-btn {
    background: #2ed573;
    color: white;
}

.resume-btn:hover {
    background: #26d467;
}

.stop-btn {
    background: #ff4757;
    color: white;
}

.stop-btn:hover {
    background: #ff3838;
}

/* Preview Section */
.preview-section {
    text-align: center;
}

.preview-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.preview-container video {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

.preview-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: #625df5;
    color: white;
}

.action-btn.primary:hover {
    background: #5a54e8;
}

.action-btn.secondary {
    background: #f1f2f6;
    color: #333;
}

.action-btn.secondary:hover {
    background: #e4e6ea;
}

/* Camera Bubble Overlay */
.camera-bubble-overlay {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 3px solid #625df5;
}

.camera-bubble-overlay video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bubble-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.bubble-control {
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.2s ease;
}

.bubble-control:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Recordings Sidebar */
.recordings-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.recordings-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.recordings-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.recording-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e9ecef;
}

.recording-item:hover {
    background: #f8f9fa;
    border-color: #625df5;
}

.recording-actions-row {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.recording-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f1f2f6;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.recording-action-btn:hover {
    transform: scale(1.1);
}

.recording-action-btn.share:hover {
    background: #625df5;
    color: white;
}

.recording-action-btn.delete:hover {
    background: #ff4757;
    color: white;
}

.recording-thumbnail {
    width: 60px;
    height: 45px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-shrink: 0;
}

.recording-info {
    flex: 1;
}

.recording-info h6 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.recording-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 8px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.view-all-btn {
    width: 100%;
    padding: 12px;
    background: #625df5;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.view-all-btn:hover {
    background: #5a54e8;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: #625df5;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(98, 93, 245, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    background: #5a54e8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(98, 93, 245, 0.4);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
}

.notification.success .notification-icon {
    color: #2ed573;
}

.notification.error .notification-icon {
    color: #ff4757;
}

.notification.info .notification-icon {
    color: #625df5;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .recorder-container {
        padding: 10px;
    }
    
    .recording-widget {
        padding: 24px;
        margin: 0 10px;
    }
    
    .mode-selection h2 {
        font-size: 24px;
    }
    
    .recording-modes {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .recordings-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .camera-bubble-overlay {
        width: 150px;
        height: 112px;
        bottom: 100px;
        right: 10px;
    }
    
    .fab {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .recording-widget {
        padding: 20px;
    }
    
    .mode-card {
        padding: 20px 12px;
    }
    
    .mode-icon {
        font-size: 28px;
        height: 40px;
    }
    
    .start-recording-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: white !important;
    transform: scale(1.05);
}

/* Custom Confirmation Modal */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.custom-modal.show {
    opacity: 1;
    visibility: visible;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.custom-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 2;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal.show .custom-modal-content {
    transform: scale(1);
}

.modal-header-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.custom-modal-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e272e;
    margin-bottom: 12px;
}

.custom-modal-content p {
    font-size: 14px;
    color: #57606f;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    flex: 1;
}

.modal-btn.cancel {
    background: #f1f2f6;
    color: #4f5f6f;
}

.modal-btn.cancel:hover {
    background: #e1e2e6;
    color: #2f3f4f;
    transform: translateY(-1px);
}

.modal-btn.delete {
    background: #ff4757;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.modal-btn.delete:hover {
    background: #ee3746;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.3);
}