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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin: 0;
}

.language-selector {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid #4CAF50;
    background: white;
    color: #4CAF50;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: #f0f8f0;
}

.lang-btn.active {
    background: #4CAF50;
    color: white;
}

.main-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.controls {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.text-section, .upload-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.text-section h3, .upload-section h3 {
    margin-bottom: 15px;
    color: #555;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #666;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
}

.input-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
}

.input-group button {
    margin-top: 5px;
    padding: 8px 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.input-group button:hover {
    background: #ff5252;
}

/* Position Controls */
.control-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.position-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pos-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pos-btn:hover {
    background: #45a049;
    transform: scale(1.1);
}

.pos-btn:active {
    transform: scale(0.95);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons button {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

#downloadBtn {
    background: #2196F3;
    color: white;
    width: 100%;
}

#downloadBtn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.canvas-container {
    flex: 1;
    min-width: 400px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#memeCanvas {
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* AdSense Styling */
.ad-banner {
    margin: 20px 0;
    text-align: center;
    background: #f8f8f8;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Responsive Ad Display */
.desktop-ad {
    display: block;
}

.mobile-ad {
    display: none;
}

.ad-sidebar {
    margin-top: 30px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.ad-banner ins, .ad-sidebar ins {
    background: transparent;
}

/* Mobile ad adjustments */
@media (max-width: 768px) {
    .ad-banner {
        margin: 15px 0;
        padding: 8px;
    }
    
    .ad-sidebar {
        margin-top: 20px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .controls {
        max-width: none;
    }
    
    .canvas-container {
        min-width: auto;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    h1 {
        font-size: 2em;
    }
    
    /* Mobile Ad Display */
    .desktop-ad {
        display: none;
    }
    
    .mobile-ad {
        display: block;
    }
}