* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: linear-gradient(135deg, #2d1b3d 0%, #3d2847 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: #ff69b4;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #b0b0b0;
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: #ff8fb3;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 105, 180, 0.1);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: rgba(255, 105, 180, 0.2);
    color: #ff69b4;
}

/* Tools Section */
.tools-section {
    margin-bottom: 40px;
}

.tools-section h2 {
    color: #ff69b4;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.tools-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.coming-soon-note {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.tool-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 350px;
}

.tool-card:hover:not(.disabled) {
    border-color: #ff69b4;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.2);
}

.tool-card.active {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.1);
}

.tool-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.tool-card h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.tool-card p {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Tool Panel */
.tool-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
}

.tool-panel h2 {
    color: #ff69b4;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.tool-description {
    color: #b0b0b0;
    margin-bottom: 20px;
}

.tool-description code {
    background: rgba(255, 105, 180, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    color: #ff8fb3;
}

/* Format Help */
.format-help {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
}

.format-help h4 {
    color: #ff8fb3;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.format-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #c0c0c0;
}

.format-item code {
    background: rgba(255, 105, 180, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    color: #ff8fb3;
    font-size: 0.85rem;
    white-space: nowrap;
}

.format-item span {
    flex: 1;
}

/* Converter Container */
.converter-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 900px) {
    .converter-container {
        grid-template-columns: 1fr;
    }
    
    .converter-controls {
        order: 1;
    }
}

.editor-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 105, 180, 0.15);
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    color: #ff8fb3;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

/* When panel-header follows tab-bar, remove top radius */
.tab-bar + .panel-header {
    border-radius: 0;
    border-left: 2px solid rgba(255, 105, 180, 0.2);
    border-right: 2px solid rgba(255, 105, 180, 0.2);
}

/* Tab Bar - sits above panel header */
.tab-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px 4px 10px;
    background: rgba(30, 15, 35, 0.8);
    border-radius: 10px 10px 0 0;
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-bottom: none;
    max-width: 100%;
    overflow: hidden;
}

.btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

textarea {
    width: 100%;
    height: 450px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-top: none;
    border-radius: 0;
    padding: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #e0e0e0;
    line-height: 1.5;
    min-height: 200px;
    max-height: 800px;
    resize: vertical;
}

#inputScript {
    border-bottom: none;
}

.emoji-bar {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-top: 1px solid rgba(255, 105, 180, 0.15);
    border-radius: 0 0 10px 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.emoji-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 105, 180, 0.2);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.emoji-btn:hover {
    background: rgba(255, 105, 180, 0.2);
    border-color: rgba(255, 105, 180, 0.5);
    transform: scale(1.15);
}

textarea:focus {
    outline: none;
    border-color: #ff69b4;
}

textarea::placeholder {
    color: #666;
}

#outputInk {
    background: rgba(0, 0, 0, 0.5);
    color: #a0e0a0;
}

/* Tab System */
.tabs-container {
    display: flex;
    gap: 3px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    margin-bottom: -10px;
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 105, 180, 0.7) rgba(0, 0, 0, 0.3);
    max-width: calc(100% - 40px); /* Account for + button width */
}

.tabs-container::-webkit-scrollbar {
    height: 12px;
}

.tabs-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    margin: 0 4px;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.7);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.tabs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 105, 180, 0.9);
}

.tab {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 105, 180, 0.15);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 6px 8px 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-width: 70px;
    max-width: 140px;
    flex-shrink: 0;
    position: relative;
}

.tab:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 105, 180, 0.3);
}

.tab.active {
    background: rgba(255, 105, 180, 0.15);
    border-color: rgba(255, 105, 180, 0.4);
    z-index: 1;
}

.tab.main-tab {
    border-left: 3px solid #ff69b4;
}

.tab.main-tab .tab-name {
    cursor: default;
}

.tab.main-tab .tab-name::before {
    content: '★ ';
    color: #ff69b4;
    font-size: 0.7em;
}

.tab.main-tab .tab-name:hover {
    background: transparent;
}

.tab-name {
    font-size: 0.8rem;
    color: #999;
    cursor: text;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.tab-name:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-name:focus {
    background: rgba(0, 0, 0, 0.3);
    outline: 1px solid rgba(255, 105, 180, 0.5);
    color: #fff;
}

.tab.active .tab-name {
    color: #ff8fb3;
    font-weight: 500;
}

.tab-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    line-height: 1;
    opacity: 0.6;
}

.tab:hover .tab-close,
.tab.active .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: rgba(255, 80, 80, 0.3);
    color: #ff6b6b;
}

.tab-add {
    background: transparent;
    border: 1px dashed rgba(255, 105, 180, 0.3);
    color: #ff8fb3;
    font-size: 1.1rem;
    font-weight: 600;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.tab-add:hover {
    background: rgba(255, 105, 180, 0.15);
    border-style: solid;
    border-color: rgba(255, 105, 180, 0.5);
}

/* Converter Controls */
.converter-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-convert {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 5px 20px rgba(255, 105, 180, 0.4);
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.5);
}

.btn-convert:active {
    transform: translateY(0);
}

/* Options Panel */
.options-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px 20px;
}

.options-panel h4 {
    color: #ff8fb3;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c0c0c0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff69b4;
    cursor: pointer;
}

/* Save/Load Panel */
.save-load-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.save-load-panel h4 {
    color: #ff8fb3;
    margin-bottom: 8px;
    font-size: 1rem;
}

.save-load-panel p {
    color: #b0b0b0;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.save-load-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-action {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.2), rgba(255, 20, 147, 0.2));
    border: 2px solid rgba(255, 105, 180, 0.3);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    flex: 1;
    min-width: 180px;
    justify-content: center;
}

.btn-action:hover {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.3), rgba(255, 20, 147, 0.3));
    border-color: #ff69b4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 0.95rem;
}

.btn-example {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(168, 85, 247, 0.2));
    border-color: rgba(168, 85, 247, 0.3);
}

.btn-example:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(168, 85, 247, 0.3));
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.3));
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* Custom Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2d1b3d 0%, #3d2847 100%);
    border: 2px solid rgba(255, 105, 180, 0.4);
    border-radius: 15px;
    padding: 25px 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    color: #ff69b4;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.modal-content p {
    color: #e0e0e0;
    margin-bottom: 20px;
    line-height: 1.6;
}

#modalInput {
    margin-bottom: 20px;
}

#modalInputField {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 105, 180, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}

#modalInputField:focus {
    outline: none;
    border-color: #ff69b4;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 25px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #b0b0b0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #ff1493, #d1477a);
    transform: translateY(-1px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 0.9rem;
}

.footer a {
    color: #ff8fb3;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .tool-panel {
        padding: 20px;
    }
    
    textarea {
        height: 300px;
    }
    
    .tab-bar {
        padding: 6px 8px 0 8px;
    }
    
    .tab {
        min-width: 60px;
        max-width: 120px;
        padding: 5px 6px 6px 8px;
    }
    
    .tab-name {
        font-size: 0.75rem;
    }
    
    .tab-add {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .btn-convert {
        width: 100%;
        margin: 10px 0;
    }
    
    .save-load-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px 10px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .format-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

