.meme-generator-container {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 50px;
}

/* BULLETPROOF: Content visible by default, animation is optional enhancement */
.meme-generator-container .scroll-animate {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Only apply animation if JavaScript successfully adds animation class */
.meme-generator-container.js-animations .scroll-animate {
    opacity: 0;
    transform: translateY(30px);
}

.meme-generator-container.js-animations .scroll-animate.in-view {
    opacity: 1;
    transform: translateY(0);
}

.generator-hero {
    text-align: center;
    margin-bottom: 40px;
}

.generator-hero h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--main-blue), var(--anim-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Step Flow Layout */
.generator-steps {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.step-container {
    background: linear-gradient(145deg, var(--accent-dark), #03223f);
    border-radius: 20px;
    border: 1px solid rgba(77, 162, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.step-container.active {
    border-color: var(--main-blue);
    box-shadow: 0 10px 30px var(--shadow);
}

.step-header {
    padding: 25px 30px;
    background: rgba(77, 162, 255, 0.1);
    border-bottom: 1px solid rgba(77, 162, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.step-number {
    background: var(--main-blue);
    color: var(--white);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-title h3 {
    color: var(--main-blue);
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    margin: 0;
}

.step-toggle {
    font-size: 1.2rem;
    color: var(--main-blue);
    transition: transform 0.3s ease;
}

.step-container.collapsed .step-toggle {
    transform: rotate(180deg);
}

.step-content {
    padding: 30px;
    display: none;
}

.step-container.active .step-content {
    display: block;
}

.step-container.collapsed .step-content {
    display: none;
}

.step-container.collapsed .step-header {
    background: rgba(77, 162, 255, 0.05);
    border-bottom: 1px solid rgba(77, 162, 255, 0.1);
}

.step-container.active .step-header {
    background: rgba(77, 162, 255, 0.1);
    border-bottom: 1px solid rgba(77, 162, 255, 0.2);
}

/* Primary Choice Section */
.primary-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.choice-card {
    background: rgba(77, 162, 255, 0.05);
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.choice-card:hover {
    background: rgba(77, 162, 255, 0.1);
    border-color: var(--main-blue);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow);
}

.choice-card.selected {
    background: rgba(77, 162, 255, 0.15);
    border-color: var(--anim-light);
}

.choice-icon {
    font-size: 2.2rem;
    color: var(--main-blue);
    margin-bottom: 12px;
}

.choice-card h4 {
    color: var(--main-blue);
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.choice-card p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 10px 0;
    line-height: 1.3;
    font-size: 0.9rem;
}

/* Usage Steps */
.usage-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.step-item .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--main-blue);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-item .step-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Info Card Styling */
.choice-card.info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: default;
}

.choice-card.info-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
    transform: none;
    box-shadow: none;
}

.choice-card.info-card .choice-icon {
    color: rgba(255, 255, 255, 0.7);
}

.choice-card.info-card h4 {
    color: rgba(255, 255, 255, 0.9);
}

/* Image Selection Modal */
.image-selection-preview {
    text-align: center;
    padding: 20px;
}

.image-selection-preview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    object-fit: contain;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--main-blue);
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(77, 162, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 20px;
    display: none;
}

.upload-zone.active {
    display: block;
}

.upload-zone:hover, .upload-zone.dragover {
    background: rgba(77, 162, 255, 0.1);
    border-color: var(--anim-light);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: var(--main-blue);
    margin-bottom: 15px;
}

/* AI Generation Form */
.ai-form {
    display: none;
    margin-top: 20px;
}

.ai-form.active {
    display: block;
}

/* AI Instructions */
.ai-instructions {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.ai-instructions p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(16, 185, 129, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-instructions i {
    color: rgba(16, 185, 129, 1);
    font-size: 0.9rem;
}



.prompt-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 15px;
    background: rgba(77, 162, 255, 0.05);
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 20px;
    min-height: 100px;
    resize: vertical;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--main-blue);
    background: rgba(77, 162, 255, 0.1);
}

/* Input Container with Voice Button */
.input-container {
    position: relative;
    margin-bottom: 20px;
}

.input-container .prompt-input {
    margin-bottom: 0;
    padding-right: 60px; /* Make room for voice button */
}

.input-container .twitter-message {
    margin-bottom: 0;
    padding-right: 60px; /* Make room for voice button */
}

.voice-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: linear-gradient(135deg, var(--main-blue), #1e3a8a);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(77, 162, 255, 0.3);
}

.voice-btn:hover {
    background: linear-gradient(135deg, #1e3a8a, var(--main-blue));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(77, 162, 255, 0.4);
}

.voice-btn:active {
    transform: translateY(0);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 1.5s infinite;
}

.voice-btn.processing {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.voice-btn i {
    font-size: 16px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6);
    }
}

/* Canvas and Editing Layout */
.editing-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.canvas-section {
    background: linear-gradient(145deg, var(--accent-dark), #03223f);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(77, 162, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-container {
    border-radius: 15px;
    overflow: hidden;
    background: transparent;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-dark);
    width: 100%;
    max-width: 600px;
}

.canvas-container canvas {
    display: block;
    border: none !important;
    outline: none !important;
    border-radius: 13px;
    background: #ffffff;
    max-width: 100%;
    height: auto;
    width: 100%;
}

.canvas-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.editing-sidebar {
    background: linear-gradient(145deg, var(--accent-dark), #03223f);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(77, 162, 255, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

/* User Images Gallery - Optimized for 500x500 square images */
.recent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding: 5px;
    min-height: 300px;
    max-height: 450px;
    overflow-y: auto;
}

.recent-item {
    aspect-ratio: 1/1;
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    background: rgba(77, 162, 255, 0.05);
    position: relative;
    min-height: 120px;
}

.recent-item:hover {
    border-color: var(--main-blue);
    transform: translateY(-2px);
}

.recent-item:active {
    transform: translateY(0px) scale(0.98);
}

.recent-item.selected {
    border-color: var(--main-blue);
    box-shadow: 0 0 0 3px rgba(77, 162, 255, 0.5);
    background: rgba(77, 162, 255, 0.1);
}

.recent-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-item .remove-image {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(255, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0;
}

.recent-item .remove-image:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.recent-item:hover .remove-image {
    opacity: 1;
}

.recent-item {
    cursor: pointer;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.empty-gallery {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

/* Meme Title Input */
.meme-title-container {
    margin-top: 8px;
    margin-bottom: 0;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.meme-title-container label {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
}

.meme-title-container input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(77, 162, 255, 0.4);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 0;
}

.meme-title-container input:focus {
    outline: none;
    border-color: var(--main-blue);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(77, 162, 255, 0.1);
}

.meme-title-container input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Terms of Service Link */
.terms-link-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(77, 162, 255, 0.2);
}

.terms-link {
    color: var(--main-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.terms-link:hover {
    color: #5ba3ff;
    text-decoration: underline;
}

/* Terms of Service Modal */
#tosModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 0;
}

.terms-modal {
    max-width: 750px;
    width: 85%;
    max-height: 85vh;
    margin: 5vh auto;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid var(--main-blue);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.terms-modal .modal-header {
    background: linear-gradient(135deg, var(--main-blue) 0%, #5ba3ff 100%);
    color: #ffffff !important;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.terms-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.terms-modal .modal-header .close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.terms-modal .modal-header .close:hover {
    opacity: 1;
}

.terms-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.terms-content {
    padding: 25px 30px;
    color: var(--text-light);
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.terms-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(77, 162, 255, 0.1);
}

.terms-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.terms-section h3 {
    color: var(--main-blue);
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms-section p {
    margin-bottom: 10px;
    color: var(--text-light);
}

.terms-section ul {
    margin: 0;
    padding-left: 20px;
}

.terms-section li {
    margin-bottom: 10px;
    color: var(--text-light);
    line-height: 1.6;
    padding-right: 8px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.terms-section li strong {
    color: var(--white);
}

.contact-section {
    background: rgba(77, 162, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(77, 162, 255, 0.2);
}

.terms-modal .modal-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 25px;
    border-top: 1px solid rgba(77, 162, 255, 0.2);
    display: flex;
    justify-content: center;
}

.terms-modal .modal-footer .btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

/* Mobile responsive for Terms Modal */
@media (max-width: 768px) {
    .terms-modal {
        width: 95%;
        margin: 2vh auto;
        max-height: 90vh;
        max-width: none;
    }
    
    .terms-content {
        padding: 20px 25px;
    }
    
    .terms-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .terms-section h3 {
        font-size: 1.1rem;
    }
    
    .terms-modal .modal-header {
        padding: 15px 20px;
    }
    
    .terms-modal .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .terms-section ul {
        padding-left: 15px;
    }
    
    .terms-section li {
        margin-bottom: 6px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .terms-modal {
        width: 98%;
        margin: 1vh auto;
        max-height: 95vh;
    }
    
    .terms-content {
        padding: 18px 20px;
    }
    
    .terms-modal .modal-header {
        padding: 12px 15px;
    }
    
    .terms-modal .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .terms-modal .modal-footer {
        padding: 15px 20px;
    }
}

/* Social Sharing Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.show {
    display: flex;
}

/* Image Preview Modal Styles */
.image-preview-modal {
    max-width: 600px;
    width: 100%;
}

.preview-content {
    text-align: center;
    margin-bottom: 25px;
}

.preview-image-container {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(77, 162, 255, 0.1);
    border-radius: 15px;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.preview-info {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--anim-light);
}

.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.preview-actions .btn-small {
    min-width: 140px;
}

.modal-content {
    background: var(--accent-dark);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--main-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(77, 162, 255, 0.2);
}

.modal-header h2 {
    color: var(--main-blue);
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-header i {
    font-size: 20px;
}

.share-preview {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(77, 162, 255, 0.1);
    border-radius: 15px;
}

.share-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid rgba(77, 162, 255, 0.3);
}

.share-message {
    width: 100%;
    min-height: 80px;
    padding: 15px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 10px;
    background: rgba(77, 162, 255, 0.05);
    color: var(--text-light);
    resize: vertical;
    font-family: inherit;
    margin-bottom: 20px;
    font-size: 14px;
}

.share-message::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.social-platforms {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.social-platform {
    background: linear-gradient(45deg, var(--main-blue), #6db9ff);
    color: var(--white);
    padding: 18px 20px;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid transparent;
    cursor: pointer;
}

.social-platform:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(77, 162, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-platform i {
    font-size: 18px;
}

.social-platform.twitter { 
    background: linear-gradient(45deg, #1DA1F2, #0d8bd9); 
}
.social-platform.twitter:hover {
    box-shadow: 0 8px 25px rgba(29, 161, 242, 0.4);
}

.social-platform.reddit { 
    background: linear-gradient(45deg, #FF4500, #cc3700); 
}
.social-platform.reddit:hover {
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.4);
}

.social-platform.facebook { 
    background: linear-gradient(45deg, #1877F2, #0d65d9); 
}
.social-platform.facebook:hover {
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.4);
}

.social-platform.instagram { 
    background: linear-gradient(45deg, #E4405F, #bc2a8d); 
}
.social-platform.instagram:hover {
    box-shadow: 0 8px 25px rgba(228, 64, 95, 0.4);
}

.social-platform.tiktok { 
    background: linear-gradient(45deg, #000000, #333333); 
}
.social-platform.tiktok:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

/* Mobile responsive styles for modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 100%;
        border-radius: 15px;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-header i {
        font-size: 18px;
    }
    
    .share-preview {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .share-preview img {
        max-width: 120px;
        max-height: 120px;
    }
    
    .share-message {
        min-height: 60px;
        padding: 12px;
        font-size: 14px;
    }
    
    .social-platform {
        padding: 15px 18px;
        font-size: 15px;
    }
    
    .social-platform i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }
    
    .modal-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-header i {
        font-size: 16px;
    }
    
    .share-preview img {
        max-width: 100px;
        max-height: 100px;
    }
    
    .social-platform {
        padding: 12px 15px;
        font-size: 14px;
        gap: 10px;
    }
}

/* Step Navigation */
.step-navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(77, 162, 255, 0.1);
}

.btn-secondary-small {
    background: linear-gradient(45deg, #666, #888);
    color: var(--white);
}

.btn-secondary-small:hover {
    background: linear-gradient(45deg, #555, #777);
}

/* Control Groups */
.control-group {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(77, 162, 255, 0.1);
    padding-bottom: 20px;
}

.control-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.control-group h4 {
    color: var(--main-blue);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-family: 'Fredoka One', cursive;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tool Buttons */
.tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.tool-btn {
    background: rgba(77, 162, 255, 0.1);
    color: var(--text-light);
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.tool-btn:hover {
    background: rgba(77, 162, 255, 0.2);
    border-color: var(--main-blue);
}

.tool-btn.active {
    background: var(--main-blue);
    color: var(--white);
    border-color: var(--anim-light);
}

/* Shape Tools */
.shape-tools {
    padding: 15px;
    background: transparent;
    border: none;
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
}

.shape-category {
    margin-bottom: 20px;
    width: 100%;
    display: block;
}

.shape-category:last-child {
    margin-bottom: 0;
}

.shape-category h6 {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 0;
    background: none;
    border: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.shape-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    padding: 0;
}

.shape-btn {
    padding: 10px;
    border: 1px solid rgba(77, 162, 255, 0.3);
    background: rgba(77, 162, 255, 0.1);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.shape-btn:hover {
    background: rgba(77, 162, 255, 0.2);
    border-color: var(--main-blue);
    transform: translateY(-1px);
}

.shape-btn.active {
    background: var(--main-blue);
    border-color: var(--main-blue);
    color: white;
}

/* Drawing Controls */
.drawing-controls {
    margin-top: 10px;
    padding: 15px;
    background: rgba(77, 162, 255, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(77, 162, 255, 0.1);
}

.drawing-controls .control-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.drawing-controls .control-row:last-child {
    margin-bottom: 0;
}

.drawing-controls label {
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
    min-width: 60px;
}

.drawing-controls input[type="color"] {
    width: 40px;
    height: 30px;
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.drawing-controls input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(77, 162, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.drawing-controls input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--main-blue);
    border-radius: 50%;
    cursor: pointer;
}

.drawing-controls input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--main-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.drawing-controls span {
    color: var(--main-blue);
    font-size: 11px;
    font-weight: 500;
    min-width: 30px;
}

/* Form Controls */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-col {
    flex: 1;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 10px;
    background: rgba(77, 162, 255, 0.05);
    color: var(--text-light);
    font-size: 0.9rem;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%234DA2FF' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 35px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-select option {
    background: var(--accent-dark);
    color: var(--text-light);
    padding: 10px;
    border: none;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--main-blue);
    background: rgba(77, 162, 255, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 5px;
    color: var(--anim-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.range-input {
    width: 100%;
    margin: 10px 0;
}

.range-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--anim-light);
}

.color-picker-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

/* Action Buttons */
.btn-small {
    background: linear-gradient(45deg, var(--main-blue), #6db9ff);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-small:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

.btn-small:disabled {
    cursor: not-allowed;
    opacity: 0.5 !important;
    transform: none !important;
}

.btn-secondary-small {
    background: transparent;
    color: var(--main-blue);
    border: 2px solid var(--main-blue);
}

.btn-secondary-small:hover:not(:disabled) {
    background: var(--main-blue);
    color: var(--white);
}

.btn-full {
    width: 100%;
    margin-bottom: 10px;
}

/* Responsive Design */
/* Model Selection */
.model-selection {
    margin-bottom: 20px;
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 10px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .model-grid {
        grid-template-columns: 1fr;
    }
}

.model-card {
    background: rgba(77, 162, 255, 0.05);
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    height: 100%;
    overflow: hidden;
}

.model-card:hover {
    background: rgba(77, 162, 255, 0.1);
    border-color: var(--main-blue);
    transform: translateY(-2px);
}

.model-card.selected {
    background: rgba(77, 162, 255, 0.15);
    border-color: var(--anim-light);
    box-shadow: 0 0 20px rgba(77, 162, 255, 0.3);
}

.model-card .model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.model-card h4 {
    color: var(--main-blue);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.model-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.model-badge.trained {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.model-badge.base {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.model-card.recommended {
    border-color: var(--main-blue);
    background: rgba(77, 162, 255, 0.1);
}

.model-card.recommended::before {
    content: "⭐ RECOMMENDED";
    position: absolute;
    top: -8px;
    left: 10px;
    background: var(--main-blue);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.model-card.recommended {
    position: relative;
}

.model-name {
    font-weight: 700;
    color: var(--main-blue);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.model-description {
    font-size: 0.8rem;
    color: var(--anim-light);
    margin-bottom: 12px;
    line-height: 1.4;
    flex-grow: 0;
    min-height: 60px;
    display: flex;
    align-items: flex-start;
}

.model-example {
    font-size: 0.75rem;
    color: rgba(192, 230, 255, 0.8);
    font-style: italic;
    line-height: 1.2;
}

/* Model Example Images */
.model-example-image {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-grow: 1;
    justify-content: flex-start;
    padding-top: 5px;
    overflow: hidden;
    margin-left: -15px;
    margin-right: -15px;
    margin-bottom: -15px;
}

.model-example-image img {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    object-fit: cover;
    border-radius: 0 0 8px 8px;
    transition: transform 0.3s ease, opacity 0.2s ease;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: rgba(77, 162, 255, 0.1); /* Placeholder background while loading */
}

.model-example-image img.loaded {
    opacity: 1; /* Fade in when loaded */
}

.model-card:hover .model-example-image img {
    transform: scale(1.05);
}

.example-prompt {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    padding: 12px 15px;
    background: rgba(1, 24, 41, 0.9);
    border-top: 1px solid rgba(77, 162, 255, 0.3);
    width: 100%;
    text-align: left;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.example-prompt strong {
    color: #00d4ff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.7rem;
}

.model-speed {
    color: var(--main-blue);
    font-weight: 600;
}

.model-speed-badge {
    background: rgba(77, 162, 255, 0.2);
    color: var(--main-blue);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .editing-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .editing-sidebar {
        order: 2;
        max-height: none;
    }
    
    .canvas-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    /* Fix header overlap issue */
    .meme-generator-container {
        padding-top: 110px;
        min-height: calc(100vh - 110px);
    }
    
    .generator-hero {
        text-align: center;
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    .generator-hero h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
        line-height: 1.2;
        text-align: center;
    }
    
    .generator-hero p {
        font-size: 1rem;
        margin-bottom: 25px;
        text-align: center;
        line-height: 1.4;
    }
    
    .primary-choice {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .choice-card {
        padding: 15px;
        min-height: 140px;
    }
    
    .choice-icon {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .choice-card h4 {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .choice-card p {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    /* Step containers */
    .step-container {
        border-radius: 15px;
    }
    
    .step-header {
        padding: 20px 25px;
    }
    
    .step-content {
        padding: 20px 25px;
    }
    
    .step-title h3 {
        font-size: 1.2rem;
    }
    
    /* Canvas and editing layout */
    .editing-layout {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }
    
    .canvas-section {
        padding: 15px;
        order: 1;
        min-height: auto;
    }
    
    .editing-sidebar {
        padding: 15px;
        order: 2;
        max-height: none;
    }
    
    .canvas-container {
        max-width: 100%;
        margin-bottom: 15px;
        width: 100%;
        border-radius: 10px;
    }
    
    .canvas-container canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
    }
    
    /* Toolbar adjustments */
    .canvas-toolbar {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .toolbar-group {
        gap: 6px;
    }
    
    .compact-btn {
        padding: 10px 12px !important;
        min-height: 44px;
        min-width: 44px;
        font-size: 0.85rem;
    }
    
    /* Control groups */
    .control-group.compact {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .control-group.compact h5 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .compact-row {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .compact-input {
        padding: 8px 10px;
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .compact-select {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .compact-buttons {
        gap: 4px;
    }
    
    .compact-btn {
        padding: 8px 10px;
        min-width: 40px;
        font-size: 0.8rem;
    }
    
    /* Images grid - 2x2 grid for mobile square images */
    .recent-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        min-height: 200px;
        max-height: 350px;
    }
    
    .recent-item {
        min-height: 80px;
        border-radius: 6px;
    }
    
    /* Model grid */
    .model-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
        margin: 0 auto;
        max-width: calc(100vw - 40px);
    }
    
    .model-card {
        padding: 15px;
        border-radius: 12px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        min-height: 380px;
    }
    
    .model-example-image img {
        width: 100%;
        aspect-ratio: 16/9;
        height: auto;
        object-fit: cover;
    }
    
    .model-description {
        min-height: 45px;
    }
    
    /* Meme title */
    .meme-title-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
        margin-top: 10px;
        border-radius: 8px;
    }
    
    .meme-title-container label {
        text-align: left;
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .meme-title-container input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* Action buttons */
    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .delete-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        margin-top: 6px;
    }
    
    /* Improve touch targets */
    button, .btn, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Color inputs */
    .color-group input[type="color"] {
        width: 36px;
        height: 28px;
    }
    
    /* Range inputs */
    .compact-range input[type="range"] {
        height: 6px;
    }
    
    .compact-range span {
        font-size: 0.75rem;
        min-width: 35px;
    }
}

/* Extra small screens - ensure heading is fully visible */
@media (max-width: 480px) {
    .meme-generator-container {
        padding-top: 150px;
        min-height: calc(100vh - 150px);
    }
    
    .generator-hero h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
        line-height: 1.1;
        padding: 0 10px;
        text-align: center;
    }
    
    .generator-hero p {
        font-size: 0.9rem;
        margin-bottom: 25px;
        padding: 0 10px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .meme-generator-container {
        padding-top: 160px;
        min-height: calc(100vh - 160px);
    }
    
    .generator-hero h1 {
        font-size: 1.6rem;
        word-break: break-word;
    }
}

/* Custom Alert/Confirm Modal Styles */
.custom-alert-modal {
    max-width: 450px;
    width: 100%;
}

.alert-content {
    text-align: center;
    padding: 20px 0;
}

.alert-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.alert-icon.info {
    color: var(--main-blue);
}

.alert-icon.success {
    color: #4CAF50;
}

.alert-icon.error {
    color: #f44336;
}

.alert-icon.warning {
    color: #ff9800;
}

.alert-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 25px;
    white-space: pre-line;
}

.alert-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.alert-actions .btn {
    min-width: 100px;
    padding: 12px 24px;
}

.btn-confirm {
    background: var(--main-blue);
    border: 2px solid var(--main-blue);
}

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

.btn-cancel {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Enhanced Canvas Editor Styles */

/* Advanced Text Effects */
.shadow-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shadow-controls label {
    font-size: 0.9rem;
    margin: 0;
}

.form-checkbox {
    width: auto;
    margin-right: 0.25rem;
}

/* Alignment Buttons */
.alignment-buttons {
    display: flex;
    gap: 0.25rem;
}

.alignment-buttons .btn-small {
    padding: 0.5rem;
    min-width: 40px;
}

.alignment-buttons .btn-small.active {
    background: var(--main-blue);
    color: white;
}

/* Layer Management */
.layer-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.layer-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.layer-list {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0.5rem;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.layer-item.active {
    background: var(--main-blue);
    color: white;
}

.layer-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.layer-type-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-size: 0.8rem;
}

.layer-actions {
    display: flex;
    gap: 0.25rem;
}

.layer-action-btn {
    background: none;
    border: none;
    color: inherit;
    padding: 0.25rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.layer-action-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Enhanced Button Styles */
.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-success:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Font Preview */
.form-select option {
    font-family: inherit;
    padding: 0.5rem;
    background: var(--accent-dark);
    color: var(--text-light);
    border: none;
}

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.auto-save-indicator.error {
    background: rgba(239, 68, 68, 0.9);
}

/* AQUA Trained Model Display */
.aqua-model-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

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

.model-header h3 {
    margin: 0;
    color: var(--main-blue);
    font-size: 1.2rem;
}

.model-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.model-badge.trained {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.model-badge.flux {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.model-description {
    color: var(--text-light);
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.model-example {
    color: var(--text-muted);
    margin: 0.5rem 0;
    font-size: 0.85rem;
    font-style: italic;
}

.model-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.speed-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== COMPACT CONTROL PANEL STYLES ===== */

/* Compact Control Groups */
.control-group.compact {
    background: rgba(1, 24, 41, 0.6);
    border: 1px solid rgba(77, 162, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.control-group.compact h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--main-blue);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-group.compact h5 i {
    font-size: 0.75rem;
}

/* Compact Buttons */
.compact-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.compact-btn {
    background: rgba(77, 162, 255, 0.1);
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 6px;
    color: var(--text-light);
    padding: 8px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-btn:hover:not(:disabled) {
    background: rgba(77, 162, 255, 0.2);
    border-color: var(--main-blue);
}

.compact-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compact-btn.active {
    background: var(--main-blue);
    border-color: var(--main-blue);
    color: white;
}

/* Upload button specific styling */
#uploadImageBtn {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: white;
}

#uploadImageBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#uploadImageBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Compact Rows */
.compact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.compact-row:last-child {
    margin-bottom: 0;
}

.compact-row label {
    font-size: 0.75rem;
    color: var(--text-light);
    min-width: 50px;
}

/* Compact Inputs */
.compact-input {
    background: rgba(77, 162, 255, 0.1);
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 4px;
    padding: 6px 8px;
    color: var(--text-light);
    font-size: 0.8rem;
    width: 100%;
    margin-bottom: 8px;
}

.compact-input:focus {
    border-color: var(--main-blue);
    outline: none;
}

.compact-select {
    background: rgba(77, 162, 255, 0.1);
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 4px;
    padding: 4px 6px;
    color: var(--text-light);
    font-size: 0.75rem;
    flex: 1;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.compact-select option {
    background: var(--accent-dark);
    color: var(--text-light);
    padding: 5px;
    border: none;
}

.compact-select:focus {
    border-color: var(--main-blue);
    outline: none;
}

/* Compact Range Controls */
.compact-range {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.compact-range input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(77, 162, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.compact-range input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--main-blue);
    cursor: pointer;
}

.compact-range span {
    font-size: 0.7rem;
    color: var(--text-light);
    min-width: 30px;
    text-align: center;
}

/* Color Groups */
.color-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.color-group label {
    font-size: 0.7rem;
    color: var(--text-light);
    min-width: auto;
}

.color-group input[type="color"] {
    width: 32px;
    height: 24px;
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

/* Alignment Buttons */
.align-buttons {
    display: flex;
    gap: 2px;
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.align-btn {
    background: rgba(77, 162, 255, 0.1);
    border: none;
    padding: 6px 8px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.align-btn:hover {
    background: rgba(77, 162, 255, 0.2);
}

.align-btn.active {
    background: var(--main-blue);
    color: white;
}

/* Shadow Toggle */
.shadow-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.shadow-toggle input[type="checkbox"] {
    width: 12px;
    height: 12px;
}

.shadow-toggle label {
    min-width: auto;
    margin: 0;
}

/* Delete Button */
.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    color: #ef4444;
    padding: 8px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 8px;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Action Buttons */
.action-btn {
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn.primary {
    background: var(--main-blue);
    border: 1px solid var(--main-blue);
    color: white;
}

.action-btn.primary:hover {
    background: #3b82f6;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: rgba(77, 162, 255, 0.1);
    border: 1px solid rgba(77, 162, 255, 0.3);
    color: var(--text-light);
}

.action-btn.secondary:hover {
    background: rgba(77, 162, 255, 0.2);
    border-color: var(--main-blue);
}

.action-btn.disabled,
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.3);
    border-color: rgba(128, 128, 128, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

.action-btn.disabled:hover,
.action-btn:disabled:hover {
    transform: none;
    background: rgba(128, 128, 128, 0.3);
}

/* Layer List Compact */
.layer-list {
    max-height: 120px;
    overflow-y: auto;
    margin-top: 8px;
}

.layer-item {
    background: rgba(77, 162, 255, 0.05);
    border: 1px solid rgba(77, 162, 255, 0.1);
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-item:hover {
    background: rgba(77, 162, 255, 0.1);
    border-color: rgba(77, 162, 255, 0.3);
}

.layer-item.active {
    background: rgba(77, 162, 255, 0.2);
    border-color: var(--main-blue);
}

/* Canvas Toolbar Styles */
.canvas-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(1, 24, 41, 0.8);
    border: 1px solid rgba(77, 162, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Compact Button Variants for Toolbar */
.compact-btn.primary {
    background: var(--main-blue);
    border-color: var(--main-blue);
    color: white;
}

.compact-btn.primary:hover {
    background: #3b82f6;
    transform: translateY(-1px);
}

.compact-btn.success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.compact-btn.success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.compact-btn.secondary {
    background: rgba(156, 163, 175, 0.2);
    border-color: rgba(156, 163, 175, 0.4);
    color: var(--text-light);
}

.compact-btn.secondary:hover {
    background: rgba(156, 163, 175, 0.3);
    border-color: rgba(156, 163, 175, 0.6);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .meme-title-container {
        padding: 12px 15px;
        margin-top: 6px;
        gap: 12px;
    }
    
    .meme-title-container label {
        font-size: 0.9rem;
        min-width: 80px;
    }
    
    .meme-title-container input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .control-group.compact {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .compact-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .compact-buttons {
        gap: 4px;
    }
    
    .compact-btn {
        padding: 6px 8px;
        min-width: 32px;
    }
    
    .canvas-toolbar {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .toolbar-group {
        gap: 4px;
    }
}

/* Credit Info Styles */
.credit-info {
    margin-top: 15px;
}

.credit-card {
    background: rgba(29, 78, 216, 0.08);
    border: 1px solid rgba(29, 78, 216, 0.25);
    border-radius: 8px;
    padding: 12px;
}

.credit-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.credit-header i {
    color: var(--main-blue);
    font-size: 1rem;
}

.credit-header h4 {
    color: var(--main-blue);
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.credit-benefits {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.benefit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}



.benefit-row i {
    color: var(--main-blue);
    font-size: 0.9rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}



.benefit-text {
    color: var(--text-light);
    line-height: 1.2;
}



/* Credit Display and Claim Button */
.credit-display {
    background: rgba(77, 162, 255, 0.1);
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.credit-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--main-blue);
    font-weight: 600;
}

.credit-balance i {
    font-size: 1.1rem;
}

.claim-credits-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid #10b981;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.claim-credits-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.claim-credits-btn:disabled {
    background: rgba(156, 163, 175, 0.3);
    border-color: rgba(156, 163, 175, 0.5);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
}

.claim-cooldown {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}


/* Active button state */
.compact-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* New Share Modal Styles */
.share-section {
    background: rgba(77, 162, 255, 0.05);
    border: 1px solid rgba(77, 162, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.share-section:hover {
    background: rgba(77, 162, 255, 0.08);
    border-color: rgba(77, 162, 255, 0.3);
}

.share-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.share-section-header i {
    font-size: 1.2rem;
    color: var(--main-blue);
}

.share-section-header h4 {
    color: var(--main-blue);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.share-description {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.share-action-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-action-btn.disabled,
.share-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gallery-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.gallery-btn:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.gallery-btn.disabled,
.gallery-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.gallery-btn.disabled:hover,
.gallery-btn:disabled:hover {
    transform: none;
    background: #666;
    box-shadow: none;
}

.twitter-btn {
    background: linear-gradient(45deg, #1DA1F2, #0d8bd9);
    color: white;
}

.twitter-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #0d8bd9, #0a73b8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.3);
}

.twitter-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.twitter-message {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 8px;
    background: rgba(77, 162, 255, 0.05);
    color: var(--text-light);
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
    font-size: 14px;
}

.twitter-message::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.character-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
    opacity: 0.7;
}

.character-count.warning {
    color: #ff9800;
}

.character-count.danger {
    color: #f44336;
}

.save-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.save-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.save-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.save-status.loading {
    background: rgba(77, 162, 255, 0.2);
    color: var(--main-blue);
    border: 1px solid rgba(77, 162, 255, 0.3);
}

.modal-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(77, 162, 255, 0.2);
    margin-top: 20px;
}

.modal-footer .btn {
    padding: 10px 20px;
    border: 1px solid rgba(77, 162, 255, 0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-footer .btn:hover {
    background: rgba(77, 162, 255, 0.1);
    border-color: rgba(77, 162, 255, 0.5);
}

/* Mobile-specific voice button adjustments */
@media (max-width: 768px) {
    .input-container .prompt-input {
        padding-right: 55px; /* More space for larger touch target */
    }
    
    .voice-btn {
        width: 45px;
        height: 45px;
        right: 5px;
        top: 5px;
        border-radius: 12px;
    }
    
    .voice-btn i {
        font-size: 18px;
    }
    
    /* Ensure good touch target size */
    .voice-btn::before {
        content: '';
        position: absolute;
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
        border-radius: 15px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .voice-btn {
        box-shadow: 0 2px 10px rgba(77, 162, 255, 0.4);
    }
    
    .voice-btn.listening {
        box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
    }
}

/* Mobile Canvas Enhancement Styles */
.mobile-text-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-dark), #03223f);
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
}

.mobile-toolbar-content {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-tool-btn {
    background: rgba(77, 162, 255, 0.2);
    border: 1px solid rgba(77, 162, 255, 0.4);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.mobile-tool-btn:hover,
.mobile-tool-btn:active {
    background: rgba(77, 162, 255, 0.4);
    transform: scale(0.95);
}

.mobile-done-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

.mobile-done-btn:hover,
.mobile-done-btn:active {
    background: linear-gradient(135deg, #059669, #047857);
}

.mobile-context-menu {
    position: fixed;
    background: linear-gradient(135deg, var(--accent-dark), #03223f);
    border: 2px solid rgba(77, 162, 255, 0.3);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    display: none;
    backdrop-filter: blur(10px);
    min-width: 160px;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-btn {
    background: rgba(77, 162, 255, 0.1);
    border: 1px solid rgba(77, 162, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-align: left;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: rgba(77, 162, 255, 0.3);
    transform: translateX(2px);
}

.mobile-menu-btn i {
    width: 16px;
    text-align: center;
}

/* Enhanced mobile canvas interactions */
@media (max-width: 768px) {
    .canvas-section {
        padding: 15px;
    }
    
    #memeCanvas {
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
    
    /* Larger touch targets for mobile */
    .canvas-toolbar .compact-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    /* Better spacing for mobile tools */
    .canvas-tools {
        gap: 8px;
    }
    
    .canvas-tools .tool-section {
        padding: 12px;
    }
    
    /* Mobile-friendly text controls */
    .text-controls {
        gap: 8px;
    }
    
    .text-controls input,
    .text-controls select {
        min-height: 40px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Drawing controls for mobile */
    #drawingControls {
        padding: 12px;
        gap: 10px;
    }
    
    #brushWidth {
        min-height: 40px;
    }
    
    /* Shape tools mobile enhancement */
    .shape-tools {
        gap: 8px;
    }
    
    .shape-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

/* Touch feedback animations */
@keyframes touchFeedback {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.mobile-tool-btn:active,
.mobile-menu-btn:active,
.shape-btn:active,
.compact-btn:active {
    animation: touchFeedback 0.15s ease;
}

/* High contrast mode for better mobile visibility */
@media (prefers-contrast: high) {
    .mobile-text-toolbar,
    .mobile-context-menu {
        border-width: 3px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    }
    
    .mobile-tool-btn,
    .mobile-menu-btn {
        border-width: 2px;
    }
}

/* Upload Image Button */
.upload-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 15px;
    margin: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.upload-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea87a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.upload-btn i {
    font-size: 16px;
}

/* Drag and Drop Styling */
.canvas-container {
    position: relative;
    transition: all 0.3s ease;
}

.canvas-container.drag-highlight {
    background: rgba(40, 167, 69, 0.1);
    border: 2px dashed #28a745;
    border-radius: 8px;
}

.canvas-container.drag-highlight::after {
    content: '📁 Drop images here to upload';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Brush Type Buttons */
.brush-type-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.brush-type-btn {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brush-type-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.brush-type-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Eraser Size Buttons */
.eraser-size-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.eraser-size-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    min-height: 36px;
}

.eraser-size-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.eraser-size-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

/* Mobile responsiveness for square canvas */
@media (max-width: 768px) {
    #memeCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
        max-height: 400px;
    }
    
    .canvas-container {
        padding: 15px;
        min-height: auto;
    }
    
    .shape-tools {
        max-height: 350px;
        padding: 12px;
        width: 100% !important;
    }
    
    .shape-tools.visible {
        display: block !important;
    }
    
    .shape-category {
        margin-bottom: 16px;
        display: block !important;
        width: 100% !important;
    }
    
    .shape-buttons {
        gap: 6px;
        justify-content: flex-start;
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        flex-direction: row !important;
    }
    
    .shape-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
        padding: 8px;
        display: inline-flex !important;
        flex: 0 0 auto !important;
    }
    
    .shape-category h6 {
        font-size: 10px;
        padding: 0;
        margin-bottom: 10px;
        display: block !important;
        width: 100% !important;
        text-align: left;
        background: none;
        border: none;
    }
    
    .brush-type-buttons {
        flex-wrap: wrap;
    }
    
    .eraser-size-buttons {
        flex-wrap: wrap;
    }
    
    .brush-type-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 12px;
    }
} 