* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #0b0f19 0%, #1a1b3c 100%);
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-header {
    text-align: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo ion-icon {
    font-size: 2.5rem;
    color: #38bdf8;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.app-header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: #1e293b;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #f8fafc;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.blocks-editor {
    background: rgba(2, 6, 23, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.blocks-editor h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blocks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scheme-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.7);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.block-scheme {
    flex: 1;
}

.block-pos {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-count {
    width: 80px;
    text-align: center;
}

.btn-remove-block {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-remove-block:hover {
    background: rgba(239, 68, 68, 0.1);
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: linear-gradient(to right, #3b82f6, #6366f1);
    color: white;
    border: none;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.action-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.action-btn.outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

.action-btn.outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.result-box {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #38bdf8;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.res-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.res-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Instructions Panel */
.instructions-panel {
    margin-top: 2rem;
}

.instructions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.instructions-header h2 {
    font-size: 1.2rem;
    color: #e2e8f0;
    margin: 0;
}

.instructions-header ion-icon {
    font-size: 1.5rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.instructions-header.open ion-icon {
    transform: rotate(180deg);
}

.instructions-content {
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.instructions-content p {
    color: #94a3b8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.definitions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.definitions-list li {
    background: rgba(30, 41, 59, 0.5);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: #cbd5e1;
}

.definitions-list li strong {
    color: #38bdf8;
    font-weight: 600;
}
