@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --bg-card: #252525;
    --border-color: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-dim: #808080;
    --accent-primary: #5865F2;
    --accent-hover: #4752C4;
    --accent-green: #57F287;
    --accent-red: #ED4245;
    --accent-yellow: #FEE75C;
    --shadow: rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body::-webkit-scrollbar {
    display: none;
}

.minecraft-font {
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
    font-weight: 400;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    vertical-align: middle;
    color: var(--accent-primary);
    opacity: 0.9;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Animated Background */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(88, 101, 242, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 101, 242, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: bgScroll 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.6s ease-out;
}

.header h1 {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #24ABFF, #0FFF5B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(36, 171, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 30px rgba(15, 255, 91, 0.6)); }
}

.header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    position: relative;
    z-index: 1;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .card {
        flex-direction: row;
    }
}


.main-content {
    flex: 1;
}

.section {
    padding: 28px;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 1s ease-out;
}

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

.preset-sidebar {
    border-left: none;
    border-top: 1px solid var(--border-color);
}

@media (min-width: 1024px) {
    .preset-sidebar {
        min-width: 350px;
        max-width: 350px;
        border-left: 1px solid var(--border-color);
        border-top: none;
        border-bottom: none;
    }

    .main-content .section:last-child {
        border-bottom: 1px solid var(--border-color);
    }
}

.label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs */
.input-field {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.1);
    transform: translateY(-2px);
}

.input-field::placeholder {
    color: var(--text-dim);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

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

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary .material-symbols-outlined {
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-success {
    background: rgba(87, 242, 135, 0.15);
    color: var(--accent-green);
    border: 2px solid rgba(87, 242, 135, 0.3);
}

.btn-success .material-symbols-outlined {
    color: var(--accent-green);
}

.btn-success:hover {
    background: rgba(87, 242, 135, 0.25);
    border-color: var(--accent-green);
    box-shadow: 0 4px 16px rgba(87, 242, 135, 0.2);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(237, 66, 69, 0.15);
    color: var(--accent-red);
    border: 2px solid rgba(237, 66, 69, 0.3);
}

.btn-danger .material-symbols-outlined {
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(237, 66, 69, 0.25);
    border-color: var(--accent-red);
    box-shadow: 0 4px 16px rgba(237, 66, 69, 0.2);
    transform: translateY(-2px);
}

/* Mode Buttons */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.mode-btn {
    padding: 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.mode-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.2);
}

.mode-btn.active {
    border-color: var(--accent-primary);
    background: rgba(88, 101, 242, 0.15);
    color: var(--accent-primary);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.3);
}

.mode-btn.active .material-symbols-outlined {
    color: var(--accent-primary);
}

.mode-btn .material-symbols-outlined {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    color: var(--accent-primary);
    opacity: 0.8;
}

/* Format Toggles */
.format-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.format-toggle {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.format-toggle:hover {
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.format-toggle.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.format-toggle.active .material-symbols-outlined {
    color: white;
}

/* Color Picker */
.color-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    min-height: 120px;
}

.color-picker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

input[type="color"] {
    width: 64px;
    height: 64px;
    border: 3px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: none;
    padding: 0;
}

input[type="color"]:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 12px;
}

.color-hex {
    font-size: 12px;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: white;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    font-size: 16px;
    line-height: 20px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    font-weight: bold;
}

.color-picker-wrapper:hover .remove-btn {
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.2) rotate(180deg);
}

/* Preview Box */
.preview-box {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 18px;
    padding: 40px;
    text-align: center;
    font-size: 32px;
    font-weight: 400;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    transition: all 0.3s;
}

.preview-box:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 40px rgba(88, 101, 242, 0.2);
}

/* Output Box */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.output-box {
    background: #0d0d0d;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    color: var(--accent-green);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    max-height: 250px;
    overflow-y: auto;
    line-height: 1.6;
    position: relative;
}

.output-box::before {
    content: '>';
    position: absolute;
    left: 8px;
    color: var(--accent-primary);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0; }
}

/* Preset Items */
.preset-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

@media (min-width: 1024px) {
    .preset-sidebar {
        display: flex;
        flex-direction: column;
        max-height: 100%;
    }

    .preset-list {
        flex: 1;
        max-height: none;
        overflow-y: auto;
    }
}

.preset-item {
    padding: 14px 18px;
    padding-right: 50px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preset-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-delete-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    opacity: 0;
    z-index: 2;
}

.preset-item:hover .preset-delete-btn {
    opacity: 1;
}

.preset-delete-btn:hover {
    background: rgba(237, 66, 69, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.preset-delete-btn .material-symbols-outlined {
    color: var(--accent-red);
    font-size: 20px;
}

.preset-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.preset-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.preset-item:hover::before {
    transform: scaleY(1);
}

.preset-item.selected {
    background: rgba(88, 101, 242, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.preset-item.selected::before {
    transform: scaleY(1);
}

/* Footer Links */
.footer-links {
    text-align: center;
    margin-top: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: fadeIn 1.2s ease-out;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-links a:hover::after {
    width: 100%;
}

/* Scrollbar - only for internal elements */
.output-box::-webkit-scrollbar,
.preset-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.output-box::-webkit-scrollbar-track,
.preset-list::-webkit-scrollbar-track {
    background: transparent;
}

.output-box::-webkit-scrollbar-thumb,
.preset-list::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.3);
    border-radius: 4px;
    transition: background 0.3s;
}

.output-box::-webkit-scrollbar-thumb:hover,
.preset-list::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 101, 242, 0.5);
}

.output-box,
.preset-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 101, 242, 0.3) transparent;
}

/* Info Box */
.info-box {
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: start;
    gap: 10px;
    animation: fadeIn 0.5s ease-out;
}

.info-box .material-symbols-outlined {
    color: var(--accent-primary);
    font-size: 22px;
    flex-shrink: 0;
}

.info-box strong {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Notification */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.notification.removing {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification.success {
    border-color: var(--accent-green);
}

.notification.success .notification-icon {
    color: var(--accent-green);
}

.notification.error {
    border-color: var(--accent-red);
}

.notification.error .notification-icon {
    color: var(--accent-red);
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.modal-text span {
    color: var(--accent-primary);
    font-weight: 600;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions .btn .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 600;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .header h1 {
        font-size: 24px;
        line-height: 1.4;
    }

    .header p {
        font-size: 14px;
    }

    .section {
        padding: 20px;
    }

    .mode-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .mode-btn {
        padding: 14px 10px;
        font-size: 13px;
    }

    .mode-btn .material-symbols-outlined {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .preview-box {
        font-size: 20px;
        padding: 24px 16px;
        min-height: 100px;
    }

    .output-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .output-header .input-field {
        width: 100% !important;
    }

    .color-container {
        padding: 16px;
        gap: 16px;
    }

    input[type="color"] {
        width: 56px;
        height: 56px;
    }

    .format-grid {
        gap: 8px;
    }

    .format-toggle {
        padding: 8px 14px;
        font-size: 12px;
        gap: 4px;
    }

    .format-toggle .material-symbols-outlined {
        font-size: 18px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    .output-box {
        font-size: 12px;
        padding: 16px;
        max-height: 200px;
    }

    .label {
        font-size: 13px;
    }

    .label .material-symbols-outlined {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .mode-btn {
        padding: 16px;
    }

    .format-toggle {
        flex: 1;
        min-width: calc(50% - 4px);
        justify-content: center;
    }
}
