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

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: #4285f4;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
}

/* Section Styles */
section {
    background: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

section h2, section h3 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Input Section */
.video-inputs {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.video-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.video-input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.remove-btn {
    background: #ff4757;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.add-video-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.add-video-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3);
}

/* Layout Controls */
.layout-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.layout-btn {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.layout-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.layout-btn.active {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

/* Control Buttons */
.controls-section {
    text-align: center;
}

.create-btn, .clear-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.create-btn {
    background: #34a853;
    color: white;
}

.create-btn:hover {
    background: #2d8f47;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 168, 83, 0.3);
}

.clear-btn {
    background: #ea4335;
    color: white;
}

.clear-btn:hover {
    background: #d33b2c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(234, 67, 53, 0.3);
}

/* Video Display Area */
.video-display {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    text-align: center;
    color: #666;
}

.placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.placeholder p {
    font-size: 1.1rem;
    color: #666;
}

/* Video Grid Layouts */
.video-grid {
    display: grid;
    gap: 15px;
    width: 100%;
    height: 100%;
}

.video-grid.layout-2x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.video-grid.layout-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.video-grid.layout-4x4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.video-grid.layout-1x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
}

.video-grid.layout-1x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
}

.video-grid.layout-1x4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
}

/* Video Container */
.video-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Global Controls */
.global-controls {
    text-align: center;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-buttons button {
    background: #4285f4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.control-buttons button:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .layout-controls {
        justify-content: center;
    }
    
    .layout-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .video-grid.layout-3x3,
    .video-grid.layout-4x4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-grid.layout-1x3,
    .video-grid.layout-1x4 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-buttons button {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .video-grid.layout-2x2,
    .video-grid.layout-3x3,
    .video-grid.layout-4x4 {
        grid-template-columns: 1fr;
    }
    
    .video-grid.layout-1x2,
    .video-grid.layout-1x3,
    .video-grid.layout-1x4 {
        grid-template-columns: 1fr;
    }
}

