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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow: hidden;
    height: 100vh;
}

/* Header */
.header {
    background-color: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #333;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.menu-btn:hover {
    background-color: #f0f0f0;
}

.title {
    font-family: 'Saira Stencil One', cursive;
    font-size: 2rem;
    font-weight: 400;
    color: #333;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-upload {
    background-color: #ff8fd6;
    color: white;
}

.btn-upload:hover {
    background-color: #60fc7a;
}

.btn-info {
    background-color: #06B6D4;
    color: white;
}

.btn-info:hover {
    background-color: #0891B2;
}

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

.btn-danger:hover {
    background-color: #DB2777;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background-color: #6366F1;
    color: white;
}

.btn-small:hover {
    background-color: #4F46E5;
}

/* Main Container */
.main-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    position: relative;
}

/* Viewer Container */
.viewer-container {
    flex: 0 0 60%;
    position: relative;
    background-color: #000;
    overflow: hidden;
}

#viewerCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Viewer Controls */
.viewer-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Annotation Controls */
.annotation-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 250px;
}

.control-group {
    margin-bottom: 0.75rem;
}

.control-group:last-child {
    margin-bottom: 0;
    display: flex;
    gap: 0.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 3rem;
    width: 60px;
    height: 80px;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.nav-arrow-left {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.nav-arrow-right {
    right: 0;
    border-radius: 8px 0 0 8px;
}

/* Drop Zone */
.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(99, 102, 241, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.drop-zone.active {
    display: flex;
}

.drop-zone-content {
    text-align: center;
    color: white;
}

.drop-zone-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.5rem;
    font-weight: 500;
}

/* Resizer */
.resizer {
    flex: 0 0 4px;
    background-color: #ddd;
    cursor: row-resize;
    transition: background-color 0.2s;
}

.resizer:hover {
    background-color: #6366F1;
}

/* File Menu */
.file-menu {
    flex: 1;
    background-color: #fff;
    overflow-y: auto;
    padding: 1.5rem;
}

.menu-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* How To Content */
.how-to-content {
    font-size: 0.9rem;
    line-height: 1.6;
}

.how-to-content ul {
    list-style: none;
    padding-left: 0;
}

.how-to-content li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.how-to-content li:before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: #6366F1;
    font-weight: bold;
}

/* Files and Gallery Lists */
.files-list,
.gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.empty-message {
    color: #999;
    font-style: italic;
    grid-column: 1 / -1;
}

/* File Item */
.file-item {
    background-color: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.file-item:hover {
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.file-item.active {
    border-color: #6366F1;
    background-color: #EEF2FF;
}

.file-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background-color: #e0e0e0;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.file-actions button {
    flex: 1;
    padding: 0.25rem;
    font-size: 0.75rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 1rem;
    }
    
    .header {
        padding: 0.75rem 1rem;
    }
    
    .viewer-controls {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .annotation-controls {
        top: 0.5rem;
        left: 0.5rem;
        min-width: 200px;
    }
    
    .nav-arrow {
        font-size: 2rem;
        width: 40px;
        height: 60px;
    }
    
    .files-list,
    .gallery-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}