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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
}

header h1 {
    color: #64b5f6;
    margin-bottom: 10px;
    font-size: 2rem;
}

header p {
    color: #9e9e9e;
    font-size: 0.95rem;
}

.back-link {
    color: inherit;
    text-decoration: none;
}

.back-link:hover {
    color: #64b5f6;
}

/* Create Project Section */
.create-project {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.create-project h2 {
    margin-bottom: 20px;
    color: #ffffff;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #3a3a3a;
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #64b5f6;
}

.input-group button {
    padding: 12px 30px;
    background: #64b5f6;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.input-group button:hover {
    background: #42a5f5;
}

#result {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #52b788;
}

#result h3 {
    color: #52b788;
    margin-bottom: 15px;
}

.share-url {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-url input {
    flex: 1;
    padding: 10px;
    border: 2px solid #3a3a3a;
    background: #2a2a2a;
    color: #64b5f6;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.share-url button {
    padding: 10px 20px;
    background: #64b5f6;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.share-url button:hover {
    background: #42a5f5;
}

#result a {
    color: #64b5f6;
    text-decoration: none;
}

#result a:hover {
    text-decoration: underline;
}

/* Project Layout */
.project-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-container {
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#youtube-player {
    width: 100%;
    aspect-ratio: 16/9;
}

.annotation-form {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 12px;
}

.annotation-form h3 {
    margin-bottom: 15px;
    color: #ffffff;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.form-row input {
    padding: 10px;
    border: 2px solid #3a3a3a;
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-row input:focus {
    outline: none;
    border-color: #64b5f6;
}

#addAnnotation {
    width: 100%;
    padding: 10px;
    background: #64b5f6;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

#addAnnotation:hover {
    background: #42a5f5;
}

/* Timeline */
.timeline-container {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 12px;
}

.timeline-container h3 {
    margin-bottom: 15px;
    color: #ffffff;
}

.timeline {
    position: relative;
    height: 60px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 2px solid #3a3a3a;
}

.timeline-line {
    position: absolute;
    width: 100%;
    height: 2px;
    top: 50%;
    background: #3a3a3a;
}

.timeline-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    transition: all 0.2s;
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

.timeline-cluster {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #1a1a1a;
    transition: all 0.2s;
}

.timeline-cluster:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.cluster-count {
    display: inline-block;
}

.timeline-mini-marker {
    animation: fadeInScale 0.3s ease forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Comments Section */
.comments-section {
    display: flex;
    flex-direction: column;
}

.annotations-list {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 12px;
    max-height: 700px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.annotations-list h3 {
    margin-bottom: 15px;
    color: #ffffff;
    position: sticky;
    top: 0;
    background: #2a2a2a;
    z-index: 10;
}

.annotation-item {
    background: #1a1a1a;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
    transition: all 0.2s;
}

.annotation-item.pending {
    border-left-color: #ffd700;
    background: #1a1a1a;
}

.annotation-item.accepted {
    border-left-color: #52b788;
    background: #1a3a2a;
}

.annotation-item.rejected {
    border-left-color: #e74c3c;
    background: #3a1a1a;
}

.annotation-item:hover {
    background: #2a2a2a;
}

.annotation-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.annotation-author {
    color: #64b5f6;
    font-weight: 600;
}

.annotation-timecode {
    color: #9e9e9e;
    cursor: pointer;
    text-decoration: underline;
}

.annotation-timecode:hover {
    color: #64b5f6;
}

.annotation-text {
    color: #e0e0e0;
    margin-bottom: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.annotation-item.accepted .annotation-text {
    color: #52b788;
}

.annotation-item.rejected .annotation-text {
    color: #e74c3c;
}

.annotation-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.annotation-actions button {
    flex: 1;
    min-width: 70px;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.delete-btn {
    background: #3a3a3a;
    color: #e0e0e0;
}

.delete-btn:hover {
    background: #e74c3c;
    color: white;
}

.accept-btn {
    background: #3a3a3a;
    color: #52b788;
}

.accept-btn:hover {
    background: #52b788;
    color: #1a1a1a;
}

.accept-btn.active {
    background: #52b788;
    color: #1a1a1a;
}

.reject-btn {
    background: #3a3a3a;
    color: #e74c3c;
}

.reject-btn:hover {
    background: #e74c3c;
    color: white;
}

.reject-btn.active {
    background: #e74c3c;
    color: white;
}

/* Responsive */
@media (max-width: 900px) {
    .project-layout {
        grid-template-columns: 1fr;
    }

    .comments-section {
        max-height: 400px;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }

    .annotation-actions {
        flex-direction: column;
    }

    .annotation-actions button {
        min-width: unset;
    }

    .input-group {
        flex-direction: column;
    }

    .share-url {
        flex-direction: column;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#loading {
    text-align: center;
    padding: 60px 20px;
    color: #9e9e9e;
    font-size: 1.2rem;
}