/* ═══════════════════════════════════════════════════════════════════════════
   PEN PLOTTER ART GENERATORS - Shared Styles
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-dark: #141413;
    --bg-light: #faf9f5;
    --mid-gray: #b0aea5;
    --light-gray: #e8e6dc;
    --accent: #d97757;
    --accent-hover: #c86641;
    --green: #2a7d4f;
    --green-hover: #1e5c3a;
    --blue: #4a7fb5;
    --blue-hover: #3a6a9e;
}

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

body {
    font-family: "JetBrains Mono", monospace;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f5f3ee 100%);
    min-height: 100vh;
    color: var(--bg-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT - Container, Sidebar, Canvas
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
    display: flex;
    min-height: 100vh;
    padding: 20px;
    gap: 20px;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(20, 20, 19, 0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.sidebar-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--light-gray);
    flex-shrink: 0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.sidebar-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--light-gray);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0 0 12px 12px;
}

.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#canvas-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: white;
}

#canvas-container svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
}

.sidebar .subtitle {
    color: var(--mid-gray);
    font-size: 12px;
    margin-bottom: 0;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACK LINK (Navigation)
   ═══════════════════════════════════════════════════════════════════════════ */

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--mid-gray);
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: var(--light-gray);
    color: var(--bg-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTROL SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.control-section {
    margin-bottom: 28px;
}

.sidebar-content .control-section:first-child {
    margin-top: 0;
}

.sidebar-content .control-section:last-child {
    margin-bottom: 0;
}

.control-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bg-dark);
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SLIDERS & CONTROLS
   ═══════════════════════════════════════════════════════════════════════════ */

.control-group {
    margin-bottom: 20px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--light-gray);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.value-display {
    font-size: 11px;
    color: var(--mid-gray);
    min-width: 50px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COLOR PICKERS
   ═══════════════════════════════════════════════════════════════════════════ */

.color-group {
    margin-bottom: 16px;
}

.color-group label {
    display: block;
    font-size: 11px;
    color: var(--mid-gray);
    margin-bottom: 4px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-container input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-value {
    font-size: 11px;
    color: var(--mid-gray);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-light);
    color: var(--bg-dark);
    border: 1px solid var(--light-gray);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.button:hover {
    background: var(--light-gray);
}

.button.primary {
    background: var(--accent);
    color: white;
    border: none;
}

.button.primary:hover {
    background: var(--accent-hover);
}

.button.svg-btn {
    background: var(--green);
    color: white;
    border: none;
}

.button.svg-btn:hover {
    background: var(--green-hover);
}

.button.png-btn {
    background: var(--blue);
    color: white;
    border: none;
}

.button.png-btn:hover {
    background: var(--blue-hover);
}

.button-row {
    display: flex;
    gap: 6px;
}

.button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROW LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.row {
    display: flex;
    gap: 16px;
}

.row .control-group {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.row .slider-container {
    min-width: 0;
}

.row .slider-container input[type="range"] {
    min-width: 0;
    width: 100%;
}

.row .value-display {
    min-width: 35px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INFO BOX
   ═══════════════════════════════════════════════════════════════════════════ */

.layer-info {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    font-size: 11px;
    color: var(--mid-gray);
    line-height: 1.6;
}

.layer-info strong {
    color: var(--mid-gray);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INDEX PAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

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

.index-header {
    text-align: center;
    margin-bottom: 48px;
}

.index-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--bg-dark);
}

.index-header .tagline {
    font-size: 14px;
    color: var(--mid-gray);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

.generators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.generator-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(20, 20, 19, 0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.generator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(20, 20, 19, 0.15);
}

.card-preview {
    aspect-ratio: 1/1;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-preview svg,
.card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-content h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-content p {
    font-size: 12px;
    color: var(--mid-gray);
    line-height: 1.5;
}

.card-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    background: var(--light-gray);
    border-radius: 4px;
    margin-top: 12px;
    color: var(--mid-gray);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.index-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--light-gray);
    font-size: 11px;
    color: var(--mid-gray);
}

.index-footer a {
    color: var(--accent);
    text-decoration: none;
}

.index-footer a:hover {
    text-decoration: underline;
}
