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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* Options Section */
.options {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.option-card {
    background: #1e2741;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 30px;
    width: 350px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #333;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.option-card h2 {
    color: #4d61fc;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.option-card p {
    color: #b0b0b0;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Form Styles */
.join-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #2a2a40;
    color: #e0e0e0;
}

.input:focus {
    outline: none;
    border-color: #4d61fc;
    box-shadow: 0 0 0 3px rgba(77, 97, 252, 0.2);
}

.or-text {
    color: #999;
    margin: 15px 0;
    font-size: 14px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #4d61fc 0%, #8b5cf6 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 97, 252, 0.4);
}

.btn-secondary {
    background: #3a3a50;
    color: #e0e0e0;
    border: 1px solid #444;
}

.btn-secondary:hover {
    background: #444;
    color: #fff;
    transform: translateY(-2px);
}

/* Meeting Room Styles */
.meeting-container {
    display: grid;
    grid-template-areas: 
        "header header"
        "video annotation"
        "controls controls";
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    height: calc(100vh - 40px);
    background: #1e2741;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    overflow: hidden;
    border: 1px solid #333;
}

/* Meeting Header */
.meeting-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.room-info h2 {
    color: #4d61fc;
    margin-bottom: 5px;
}

.room-meta {
    display: flex;
    gap: 20px;
    color: #b0b0b0;
    font-size: 14px;
}

/* Video Section */
.video-section {
    grid-area: video;
    background: #0f0f23;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #333;
}

#sharedVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.screen-status {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(30, 39, 65, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
    border: 1px solid #4d61fc;
}

/* Canvas for annotations */
#annotationCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 5;
    pointer-events: none;
}

#annotationCanvas.active {
    pointer-events: all;
}

/* Annotation Tools */
.annotation-tools {
    grid-area: annotation;
    background: #2a2a40;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid #333;
}

.tool-section h3 {
    color: #e0e0e0;
    margin-bottom: 15px;
    font-size: 16px;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: #333;
    transform: scale(1.1);
}

.color-red { background: #ff4757; }
.color-blue { background: #3742fa; }
.color-green { background: #2ed573; }
.color-yellow { background: #ffa502; }
.color-black { background: #2f3542; }
.color-white { background: #ffffff; border: 1px solid #ddd; }

/* Brush Size */
.brush-size {
    display: flex;
    gap: 10px;
    align-items: center;
}

.size-option {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2a2a40;
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e0e0e0;
}

.size-option:hover {
    border-color: #4d61fc;
}

.size-option.active {
    border-color: #4d61fc;
    background: #4d61fc;
    color: white;
}

.size-dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.size-option:nth-child(2) .size-dot {
    width: 12px;
    height: 12px;
}

.size-option:nth-child(3) .size-dot {
    width: 16px;
    height: 16px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 10px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2a2a40;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e0e0e0;
}

.action-btn:hover {
    border-color: #4d61fc;
    color: #4d61fc;
}

.action-btn.active {
    background: #4d61fc;
    color: white;
    border-color: #4d61fc;
}

/* Control Bar */
.control-bar {
    grid-area: controls;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #2a2a40;
    border-radius: 8px;
    border: 1px solid #333;
}

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

.control-btn span {
    margin-top: 5px;
}

.control-btn:hover {
    transform: translateY(-2px);
}

.control-btn.primary {
    background: linear-gradient(135deg, #4d61fc 0%, #8b5cf6 100%);
    color: white;
}

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

.control-btn.secondary {
    background: #3a3a50;
    color: #e0e0e0;
    border: 1px solid #444;
}

/* Room Info Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1e2741;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
}

.modal h2 {
    color: #4d61fc;
    margin-bottom: 20px;
}

.room-url {
    background: #2a2a40;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    font-size: 14px;
    color: #e0e0e0;
    border: 1px solid #333;
}

.url-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: #b0b0b0;
    font-size: 14px;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .meeting-container {
        grid-template-areas: 
            "header"
            "video"
            "annotation"
            "controls";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
    }
    
    .annotation-tools {
        flex-direction: row;
        overflow-x: auto;
        padding: 15px;
    }
    
    .tool-section {
        min-width: 200px;
    }
    
    .options {
        gap: 20px;
    }
    
    .option-card {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .join-form {
        flex-direction: column;
    }
    
    .control-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 11px;
    }
}

/* Status Messages */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.status-message.success {
    background: #2ed573;
}

.status-message.error {
    background: #ff4757;
}

.status-message.info {
    background: #3742fa;
}

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

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

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