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

body {
    background-color: #2d3a2d;
    font-family: 'Tinos', serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    text-align: center;
    max-width: 1200px;
    width: 100%;
}

h1 {
    color: #ffffff;
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    margin-bottom: 30px;
    word-break: break-all;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.meme-editor {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.meme-canvas {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
    border: 3px solid #4a5a4a;
    border-radius: 10px;
    overflow: hidden;
    background-color: #ffffff;
}

#baseImage {
    display: block;
    max-width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
}

.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 5px 10px;
    background-color: transparent;
    border: none;
    border-radius: 5px;
    min-width: 100px;
    font-size: 24px;
    font-weight: bold;
    color: #000000;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
}

.text-element:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px dashed #007bff;
}

.text-element.selected {
    border: 2px solid #007bff;
    background-color: transparent;
}

.text-element.selected:hover {
    border-color: #0056b3;
    background-color: transparent;
}

.text-element input {
    border: none;
    background: transparent;
    outline: none;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
    width: 100%;
    min-width: 80px;
    transition: font-family 0.2s ease;
}

.text-controls {
    position: absolute;
    top: -30px;
    right: 0;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.text-element:hover .text-controls {
    opacity: 1;
}

.text-element .size-controls {
    opacity: 0;
    transition: opacity 0.2s;
}

.text-element.selected .size-controls {
    opacity: 1;
}

.font-select {
    padding: 2px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    background-color: white;
}

.size-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 5px;
}

.size-btn {
    width: 16px;
    height: 12px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    padding: 0;
    line-height: 1;
}

.size-btn:hover {
    background-color: #f0f0f0;
    border-color: #007bff;
}

.size-btn:active {
    background-color: #e0e0e0;
}

.color-picker {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.delete-btn {
    background-color: #ff4757;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
}

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

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tinos', serif;
    background-color: #ffffff;
    color: #000000;
}

#addTextBtn {
    background-color: #000000;
    color: #ffffff;
}

#addTextBtn:hover {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.download-btn {
    background-color: #ffffff;
    color: #000000;
}

.download-btn:hover {
    background-color: #000000;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Font classes - these are now handled by JavaScript inline styles */
.text-element.font-anton,
.text-element.font-anton input {
    font-family: 'Anton', sans-serif !important;
}

.text-element.font-bangers,
.text-element.font-bangers input {
    font-family: 'Bangers', cursive !important;
}

.text-element.font-great-vibes,
.text-element.font-great-vibes input {
    font-family: 'Great Vibes', cursive !important;
}

.text-element.font-tinos,
.text-element.font-tinos input {
    font-family: 'Tinos', serif !important;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .meme-editor {
        padding: 0;
    }
    
    .text-element {
        font-size: 18px;
        min-width: 80px;
        padding: 3px 8px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .text-controls {
        gap: 8px;
    }
    
    .font-select, .color-picker, .delete-btn {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    .size-btn {
        width: 14px;
        height: 10px;
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .meme-editor {
        padding: 0;
    }
    
    .text-element {
        font-size: 16px;
        min-width: 60px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}
