/* ============================================
   Academic Meeting Platform - Style Sheet
   Modern Dark Theme with Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background:
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.1) 0%, transparent 40%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(2%, 2%) rotate(1deg);
    }

    50% {
        transform: translate(-1%, 3%) rotate(-1deg);
    }

    75% {
        transform: translate(3%, -2%) rotate(2deg);
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 25px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--bg-glass);
    color: white;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* Hero Visual */
.hero-visual {
    position: relative;
}

.meeting-preview {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.preview-title {
    font-weight: 600;
    color: var(--text-primary);
}

.preview-badge {
    background: var(--success);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.preview-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.video-tile {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-tile::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0.3;
}

.video-tile i {
    font-size: 2rem;
    color: var(--text-secondary);
    z-index: 1;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-glass);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--success);
}

.control-btn.danger {
    background: var(--danger);
}

/* Features Section */
.features {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Join Section */
.join-section {
    padding: 80px 0;
}

.join-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 50px;
    text-align: center;
    backdrop-filter: blur(20px);
    max-width: 600px;
    margin: 0 auto;
}

.join-card h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.join-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.join-input {
    flex: 1;
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    text-align: center;
}

.join-input::placeholder {
    color: var(--text-muted);
}

.join-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Schedule Section */
.schedule-section {
    padding: 80px 0;
}

.schedule-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
}

.schedule-form {
    display: grid;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* My Meetings */
.my-meetings {
    padding: 80px 0;
}

.meetings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meeting-item {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.meeting-item:hover {
    border-color: var(--primary);
}

.meeting-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.meeting-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meeting-actions {
    display: flex;
    gap: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--bg-glass);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger);
}

/* Meeting Room Styles */
.meeting-room {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.room-header {
    padding: 15px 20px;
    background: rgba(15, 15, 26, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.room-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.room-timer {
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1rem;
}

.room-actions {
    display: flex;
    gap: 10px;
}

.copy-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.copy-link-btn:hover {
    background: var(--primary);
}

.room-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.video-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.main-video-grid {
    flex: 1;
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.video-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.video-box.screen-share {
    grid-column: span 2;
}

.video-label {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.video-placeholder .avatar {
    width: 100px;
    height: 100px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
}

.participants-sidebar {
    width: 280px;
    background: rgba(15, 15, 26, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.participant-item:hover {
    background: var(--bg-glass);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.participant-name {
    flex: 1;
}

.participant-status {
    display: flex;
    gap: 8px;
}

.participant-status i {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.participant-status i.active {
    color: var(--success);
}

/* Controls Bar */
.controls-bar {
    padding: 20px;
    background: rgba(15, 15, 26, 0.95);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 15px;
}

.control-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--bg-glass);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-button:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.control-button.active {
    background: var(--success);
}

.control-button.off {
    background: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.control-button.off:hover {
    background: var(--danger);
    color: white;
}

.control-button.end-call {
    background: var(--danger);
    width: 70px;
    border-radius: 35px;
}

.control-button.end-call:hover {
    background: #dc2626;
}

.control-button .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.control-button:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Join Page */
.join-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.join-container {
    max-width: 800px;
    width: 100%;
}

.join-preview {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
}

.preview-video-container {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.preview-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-controls-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.join-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.name-input {
    width: 100%;
    max-width: 400px;
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    text-align: center;
}

.name-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .participants-sidebar {
        display: none;
    }

    .main-video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .join-input-group {
        flex-direction: column;
    }

    .control-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .controls-bar {
        gap: 10px;
    }
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px 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);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}