* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5865F2;
    --primary-hover: #4752C4;
    --secondary-color: #57F287;
    --danger-color: #ED4245;
    --background: #0f0f10;
    --surface: #1a1a1d;
    --surface-hover: #232327;
    --surface-elevated: #2b2b30;
    --text-primary: #ffffff;
    --text-secondary: #b9bbbe;
    --text-muted: #72767d;
    --border-color: #2b2b30;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f10 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 3rem;
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Navigation */
.tools-nav {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.tool-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tool-tab:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.tool-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.tool-tab .icon {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.tool-section {
    display: none;
}

.tool-section.active {
    display: block;
}

.tool-header {
    margin-bottom: 2rem;
}

.tool-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Styles */
.discord-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    padding: 0.75rem 1rem;
    background: var(--surface-elevated);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Color Input */
.color-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: var(--surface-elevated);
}

.color-input-group input[type="text"] {
    flex: 1;
}

/* Collapsible Sections */
.collapsible-section {
    background: var(--surface-elevated);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.collapsible-header {
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.collapsible-header:hover {
    background: var(--surface-hover);
}

.collapsible-header .chevron {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.collapsible-header.active .chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.active {
    max-height: 1000px;
    padding: 1rem 1.25rem;
}

/* Checkbox */
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Fields */
#fields-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.field-item {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.field-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.btn-remove {
    background: var(--danger-color);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #c03436;
    transform: scale(1.05);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    width: 100%;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Actions */
.form-actions {
    margin-top: 1rem;
}

/* Status Message */
.status-message {
    padding: 1rem;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    display: none;
    margin-top: 1rem;
}

.status-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.status-message.success {
    background: rgba(87, 242, 135, 0.1);
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.status-message.error {
    background: rgba(237, 66, 69, 0.1);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .main-content {
        padding: 2.5rem;
    }

    .tool-header h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .color-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .color-input-group input[type="color"] {
        width: 100%;
    }

    .btn-primary {
        padding: 0.875rem 1.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

