:root {
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #8b5cf6;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Animated Shapes */
.background-shape-1 {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    background: var(--primary);
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.3;
    z-index: -1;
    animation: float 8s infinite alternate;
}

.background-shape-2 {
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent);
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.2;
    z-index: -1;
    animation: float 10s infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

header .dot {
    color: var(--primary);
}

header p {
    color: var(--text-muted);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}


.input-group input:focus, .input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.input-group select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.customization-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.color-options, .style-options {
    display: flex;
    gap: 1rem;
}

.color-options .input-group-inline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.input-group-inline label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group-inline input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}

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

.input-group-inline input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--glass-border);
    border-radius: 50%;
}

.style-options .input-group {
    flex: 1;
    margin-bottom: 0;
}

button {
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.hidden {
    display: none !important;
}

#result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

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

#qr-code-box {
    background: white;
    padding: 1rem;
    border-radius: 12px;
}

#qr-code-box img, #qr-code-box canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.secondary-btn, .outline-btn {
    flex: 1;
    padding: 0.8rem;
    font-size: 0.95rem;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
}

.outline-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-btn {
    background: transparent;
    color: #ef4444;
    padding: 0;
    font-size: 0.9rem;
}

.text-btn:hover {
    text-decoration: underline;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar for history */
.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

.history-item {
    background: rgba(15, 23, 42, 0.5);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.history-item:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
    width: 75%;
}

.history-text {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    gap: 0.2rem;
}

.icon-btn {
    background: transparent;
    padding: 0.5rem;
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 0.9rem;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.8;
}
