* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background-color 0.2s, color 0.2s;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent), #7928ca);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.upload-section {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border: 2px dashed var(--border);
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.upload-text h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

.btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background-color: rgba(0, 114, 245, 0.1);
}

.glyph-container {
    display: none;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.glyph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.glyph-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.glyph-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.glyph-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
    padding: 10px;
    width: 100%;
    overflow-x: auto;
}

.glyph-cell {
    aspect-ratio: 1/1;
    position: relative;
    cursor: pointer;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glyph-cell:hover {
    outline: 2px solid var(--accent);
}

.glyph-cell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.glyph-tooltip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    bottom: 100%;
    top: auto;
}
 
.glyph-cell:hover .glyph-tooltip {
    opacity: 1;
}

.notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 100;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.instructions {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--card-shadow);
}

.instructions h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.instructions p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.instructions code {
    background-color: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .upload-section {
        padding: 1rem;
    }

    .upload-area {
        padding: 1rem;
    }

    .glyph-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

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

    .glyph-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}