@font-face {
    font-family: 'SourceSans3';
    src: url('SourceSans3-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'SourceSans3';
    src: url('SourceSans3-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 400;
    background-color: #ebebeb;
    color: #000000;
    line-height: 1.6;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 2rem;
    z-index: 1000;
}

.nav-link {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #000000;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 0.6;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 4rem;
}

.title {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subtitle {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Mode Toggle */
.mode-selector {
    text-align: center;
    margin-bottom: 3rem;
}

.mode-toggle {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem 2rem;
    background-color: #000000;
    color: #ebebeb;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: opacity 0.3s ease;
}

.mode-toggle:hover {
    opacity: 0.8;
}

/* Mode Sections */
.mode-section {
    margin-bottom: 2rem;
}

/* Canvas */
.canvas-container {
    width: 100%;
    height: 500px;
    background-color: #ffffff;
    border: 2px solid #000000;
    margin-bottom: 2rem;
    cursor: crosshair;
}

#drawingCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Controls */
.controls {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#colorPicker {
    width: 60px;
    height: 40px;
    border: 2px solid #000000;
    cursor: pointer;
    background: none;
}

#brushSize {
    width: 150px;
    cursor: pointer;
}

/* Text Input */
.text-container {
    margin-bottom: 2rem;
}

#textInput {
    width: 100%;
    padding: 1.5rem;
    font-family: 'SourceSans3', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    background-color: #ffffff;
    border: 2px solid #000000;
    resize: vertical;
    min-height: 300px;
}

#textInput:focus {
    outline: none;
    border-color: #000000;
}

#textInput::placeholder {
    color: #999999;
}

/* Buttons */
.btn {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem 2rem;
    border: 2px solid #000000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #000000;
    color: #ebebeb;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background-color: #ebebeb;
    color: #000000;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #ebebeb;
    color: #000000;
}

.btn-secondary:hover {
    background-color: #000000;
    color: #ebebeb;
}

/* Success Message */
.success-message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background-color: #000000;
    color: #ebebeb;
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.success-message.show {
    opacity: 1;
}

/* Gallery */
.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    background-color: #ebebeb;
    color: #000000;
    border: 2px solid #000000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #000000;
    color: #ebebeb;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.gallery-item {
    background-color: #ffffff;
    border: 2px solid #000000;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.item-content {
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.item-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.text-content {
    align-items: flex-start;
    text-align: left;
}

.text-content p {
    font-family: 'SourceSans3', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-top: 2px solid #000000;
    font-family: 'SourceSans3', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Loading and Empty States */
.loading,
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    font-family: 'SourceSans3', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 5rem 1.5rem 3rem;
    }
    
    .nav {
        padding: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .control-group {
        width: 100%;
    }
    
    #brushSize {
        width: 100%;
    }
    
    .canvas-container {
        height: 400px;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .canvas-container {
        height: 300px;
    }
    
    .mode-toggle {
        font-size: 0.9rem;
        padding: 0.875rem 1.5rem;
    }
}