:root {
    --primary: #6200ee;
    --primary-hover: #3700b3;
    --secondary: #03dac6;
    --secondary-hover: #018786;
    --surface: #ffffff;
    --background: #f5f5f5;
    --text: #1d1d1d;
    --border: #e0e0e0;
    --elevation-1: 0 2px 4px -1px rgba(0,0,0,0.2), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12);
    --elevation-2: 0 3px 5px -1px rgba(0,0,0,0.2), 0 6px 10px 0 rgba(0,0,0,0.14), 0 1px 18px 0 rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition);
    margin-left: auto;
}

.btn-icon:hover {
    background-color: rgba(98, 0, 238, 0.04);
}

.btn-icon:active {
    background-color: rgba(98, 0, 238, 0.08);
}
header {
    margin-bottom: 2rem;
    position: relative;
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}


.header  h1 {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--primary);
}

.title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.icon-wrapper .material-icons {
    font-size: 28px;
    color: white;
}



.subtitle {
    font-size: 1.1rem;
    color: #666;
}

.elevation-1 {
    box-shadow: var(--elevation-1);
}

.grid-controls {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

label .material-icons {
    font-size: 20px;
    color: var(--primary);
}

.input-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

input[type="number"] {
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    width: 100px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--surface);
}

input[type="number"]:focus {
    border-color: var(--primary);
    outline: none;
}

input[type="number"]:hover {
    border-color: var(--text);
}

.controls {
    background-color: var(--surface);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.grid-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="number"] {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="number"]:focus {
    border-color: var(--primary);
    outline: none;
}

.builder-container {
    margin-bottom: 2rem;
    margin: 24px 0;
    padding: 24px;
    border-radius: 8px;
    background-color: var(--surface);
}

.builder-container h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text);
}

.builder {
    position: relative;
    width: 100%;
    height: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: crosshair;
    overflow: hidden;
    padding: 20px;
}

#builderOverlay {
    position: absolute;
    background: rgba(33, 150, 243, 0.3);
    border: 2px solid var(--primary);
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
}

.table-preview {
    background-color: var(--surface);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    min-height: 400px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-preview table {
    border-collapse: collapse;
    background: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-preview.active table {
    opacity: 1;
}

.table-preview td, .table-preview th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    background: white;
    min-width: 60px;
    height: 40px;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s;
}

.table-preview th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.table-preview tr:nth-child(even) td {
    background: #f8f9fa;
}

#builderSize {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 0;
}

.builder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(to right, #f0f0f0 1px, transparent 1px) 0 0 / 20px 20px,
        linear-gradient(to bottom, #f0f0f0 1px, transparent 1px) 0 0 / 20px 20px;
    z-index: 0;
}

.code-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    padding: 1rem 2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    position: relative;
}

.tab-button.active {
    color: var(--primary);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.code-container {
    position: relative;
    padding: 1rem;
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-button:hover {
    background: #e9ecef;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-content li {
    margin-bottom: 0.5rem;
}

#closeModal {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#closeModal:hover {
    background: #3700b3;
}

#snackbar {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 1rem;
    position: fixed;
    z-index: 1;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
}

#snackbar.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.icon-button:hover {
    background-color: rgba(0,0,0,0.1);
}

.header .btn-icon .material-icons {
    font-size: 32px !important;
    color: var(--primary);
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.back-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.back-button:hover {
    color: var(--primary);
}

.back-button .material-icons {
    margin-right: 0.5rem;
}

.help-button {
    position: relative;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.help-button:hover {
    background: var(--background);
    color: var(--primary);
    border-color: var(--primary);
} 