* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 15px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.insta-icon {
    font-size: 32px;
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 24px;
    color: #333;
    font-weight: 800;
}

.tagline {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Input Section */
.input-section {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #444;
    margin: 15px 0 10px 0;
    font-size: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.char-count {
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

textarea::placeholder {
    color: #999;
}

/* Buttons Grid */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    border-radius: 15px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
}

.style-btn:active {
    transform: translateY(3px);
    opacity: 0.9;
}

.btn-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

.btn-label {
    font-size: 12px;
}

/* Button Colors */
.bold-btn { background: linear-gradient(135deg, #ff7e5f, #feb47b); color: white; }
.italic-btn { background: linear-gradient(135deg, #7F7FD5, #86A8E7); color: white; }
.cursive-btn { background: linear-gradient(135deg, #DA4453, #89216B); color: white; }
.small-btn { background: linear-gradient(135deg, #3a7bd5, #00d2ff); color: white; }
.mono-btn { background: linear-gradient(135deg, #FF5F6D, #FFC371); color: white; }
.star-btn { background: linear-gradient(135deg, #f7971e, #ffd200); color: white; }
.heart-btn { background: linear-gradient(135deg, #ff6b6b, #ffa8a8); color: white; }
.sparkle-btn { background: linear-gradient(135deg, #834d9b, #d04ed6); color: white; }

/* Emoji Grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.emoji-btn {
    height: 50px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    background: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-btn:active {
    transform: scale(0.9);
    background: #f8f9fa;
    border-color: #667eea;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.action-btn {
    padding: 15px 10px;
    border-radius: 15px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:active {
    transform: translateY(3px);
}

.clear-btn { background: #ff6b6b; color: white; }
.undo-btn { background: #5f27cd; color: white; }
.preview-btn { background: #1dd1a1; color: white; }
.save-btn { background: #feca57; color: #333; }

/* Copy Button */
.copy-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #10ac84, #1dd1a1);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(16, 172, 132, 0.3);
}

.copy-btn:active {
    transform: translateY(3px);
    box-shadow: 0 4px 10px rgba(16, 172, 132, 0.3);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #10ac84;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    color: #333;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:active {
    background: #e9ecef;
}

.modal-body {
    padding: 25px;
}

.preview-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    font-size: 18px;
    line-height: 1.6;
    min-height: 150px;
    border: 2px dashed #ddd;
}

.preview-note {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 15px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.footer-note {
    font-size: 12px;
    margin-top: 5px;
    color: #888;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        border-radius: 20px;
    }
    
    .buttons-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .style-btn {
        min-height: 65px;
        padding: 10px 5px;
    }
    
    h1 {
        font-size: 20px;
    }
}