.layout-icons {
    display: flex;
    gap: 10px;
}
.layout-icon {
    cursor: pointer;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.layout-icon.active {
    border: 2px solid #a71111;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #e0e0e0;
}
header {
    background-color: #222;
    padding: 10px 20px;
    position: relative;
    justify-content: center;
    align-items: center;
}

header .logo-text {
    font-size: 2em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.header-content {
    display: flex;
    align-items: center;
}

.header-image {
    width: 100px; /* Adjust as needed */
    height: auto;
}

.logo {
    text-align: center;
    flex-grow: 1;
}

.logo-text {
    font-family: 'Bungee Tint', cursive;
    font-size: 40px;
    color: #ff0000; /* Red color as shown in the image */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    gap: 15px;
}

nav a {
    font-family: 'Bungee Tint', cursive;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1em;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
    }

    nav {
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
main {
    padding: 30px;
}
h1 {
    font-size: 36px;
    margin-bottom: 20px;
}
.title-section {
    display: flex;
    align-items: baseline;
    margin-right: 55px;
}
.title-section h1 {
    font-size: 30px;
    margin-right: 15px;
}
.title-section span {
    font-size: 28px;
    color: #cc4444;
}


.gallery-grid {
    display: flex;
    flex-wrap: wrap;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    width: calc(33.333% - 20px); /* Subtracting gutter */
    margin-bottom: 20px;
    box-sizing: border-box;
    margin: 10px;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

.caption {
    padding: 10px;
    text-align: center;
    font-size: 14px;
    color: #333;
}

.gallery-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.gallery-controls label {
    margin-right: 10px;
    font-weight: bold;
    color: #333;
}

.styled-select {
    appearance: none;
    background-color: #f0f0f0;
    border: 2px solid #333;
    border-radius: 5px;
    padding: 8px 30px 8px 10px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z' fill='%23333'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.styled-select:focus {
    outline: none;
    border-color: #007bff;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination button {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination button:hover {
    background-color: #007bff;
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .gallery-item {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: calc(100% - 20px);
    }
}

.generate-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
    justify-content: center;
}

.controls select,
.controls input {
    padding: 0.5rem;
    font-size: 1rem;
    background-color: transparent;
    color: #ddd; /* Red color for text */
    border: 2px solid #ddd; /* Red border */
    border-radius: 5px;
    outline: none;
}

.controls select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ff0000' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
    padding-right: 2rem;
}

.controls input {
    width: 80px;
}

.controls select:focus,
.controls input:focus {
    border-color: #ffff00; /* Yellow border on focus */
    color: #ffff00; /* Yellow text on focus */
}

.controls button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: 'Bungee Tint', cursive; /* Use the heading font */
    background-color: transparent;
    color: #ddd; /* Red color for text */
    border: 2px solid #ddd; /* Red border */
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls button:hover {
    background-color: #d6e04c;
    color: #1a1a1a;
}

#canvasContainer {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 2rem;
    /* Improve canvas rendering quality */
    image-rendering: -webkit-optimize-contrast; /* Webkit */
    image-rendering: crisp-edges; /* Standard */
    image-rendering: pixelated; /* For pixel art style */
}

#canvasContainer canvas {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.pagination button.active {
    background-color: #007bff;
    font-weight: bold;
}

.layout-1 .gallery-item {
    width: calc(100% - 20px);
}

.layout-3 .gallery-item {
    width: calc(33.333% - 20px);
}

.layout-5 .gallery-item {
    width: calc(20% - 20px);
}

@media (max-width: 768px) {
    .layout-3 .gallery-item,
    .layout-5 .gallery-item {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .layout-3 .gallery-item,
    .layout-5 .gallery-item {
        width: calc(100% - 20px);
    }
}

/* Add this to your existing styles.css file */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   SCIENTIFIC CA GENERATOR STYLES
   ============================================ */

.scientific-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-top: 2rem;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1200px) {
    .scientific-container {
        grid-template-columns: 1fr;
    }
}

/* Parameter Panel */
.parameter-panel {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2a2a;
}

.parameter-panel::-webkit-scrollbar {
    width: 6px;
}

.parameter-panel::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.parameter-panel::-webkit-scrollbar-thumb {
    background: #cc4444;
    border-radius: 3px;
}

.parameter-panel::-webkit-scrollbar-thumb:hover {
    background: #ff0000;
}

/* Parameter Sections */
.param-section {
    background: transparent;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #222;
    color: #ff0000;
    font-weight: 600;
    font-size: 14px;
}

.section-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.section-header.collapsible:hover {
    background: #2a2a2a;
}

.section-header h3 {
    margin: 0;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.section-header i {
    font-size: 16px;
    opacity: 0.9;
}

.toggle-icon {
    transition: transform 0.2s ease;
    font-size: 12px !important;
    opacity: 0.7;
}

.section-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.param-content {
    padding: 14px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    background: #1a1a1a;
}

.param-content.collapsed {
    max-height: 0;
    padding: 0 14px;
}

/* Parameter Groups */
.param-group {
    margin-bottom: 16px;
}

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

.param-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #ddd;
    font-size: 13px;
}

.param-label {
    font-weight: 500;
    flex: 1;
    color: #e0e0e0;
}

.param-value {
    background: #cc4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    min-width: 40px;
    text-align: center;
}

.param-info {
    cursor: help;
    opacity: 0.7;
    font-size: 16px;
    color: #ddd;
}

.validation-icon {
    font-size: 16px;
    min-width: 20px;
}

.validation-icon.valid::before {
    content: "✓";
    color: #ffff00;
}

.validation-icon.invalid::before {
    content: "✗";
    color: #ff0000;
}

/* Inputs */
.param-input {
    width: 100%;
    padding: 8px 10px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ddd;
    font-size: 13px;
    transition: all 0.2s ease;
}

.param-input:focus {
    outline: none;
    border-color: #ffff00;
    color: #ffff00;
    background: #0f0f0f;
}

.param-input.monospace {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.input-with-button {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.input-with-button .param-input {
    flex: 1;
}

.icon-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #cc4444;
    border-color: #cc4444;
    color: #fff;
}

/* Sliders */
.param-slider {
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 8px 0;
}

.param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #cc4444;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 2px #1a1a1a;
}

.param-slider::-webkit-slider-thumb:hover {
    background: #ff0000;
    box-shadow: 0 0 0 2px #1a1a1a, 0 0 8px rgba(255, 0, 0, 0.3);
}

.param-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #cc4444;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    transition: all 0.2s ease;
}

.param-slider::-moz-range-thumb:hover {
    background: #ff0000;
}

/* Buttons */
.param-button {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ddd;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.param-button:hover {
    background: #cc4444;
    border-color: #cc4444;
    color: #fff;
}

.param-button.secondary {
    background: transparent;
    border: 1px solid #333;
    color: #aaa;
}

.param-button.secondary:hover {
    background: #2a2a2a;
    border-color: #444;
    color: #ddd;
}

.param-hint {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.action-btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn.primary {
    background: #cc4444;
    color: #fff;
    border: 1px solid #cc4444;
}

.action-btn.primary:hover {
    background: #ff0000;
    border-color: #ff0000;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

.action-btn:not(.primary) {
    background: transparent;
    color: #ddd;
    border: 1px solid #333;
}

.action-btn:not(.primary):hover {
    background: #2a2a2a;
    border-color: #444;
}

/* Config Buttons */
.config-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

/* Generation Info */
.generation-info {
    background: #0a0a0a;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
    border: 1px solid #2a2a2a;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #222;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #888;
    font-weight: 500;
    font-size: 12px;
}

.info-value {
    color: #ffff00;
    font-weight: 600;
    font-size: 12px;
}

.monospace {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Palette Preview */
.palette-preview {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.palette-swatch {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.palette-swatch:hover {
    transform: scale(1.05);
    border-color: #cc4444;
    box-shadow: 0 0 8px rgba(204, 68, 68, 0.3);
}

/* Canvas Wrapper */
.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background: #1a1a1a;
    border-radius: 6px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    animation: slideIn 0.25s ease-out;
    border: 1px solid #2a2a2a;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #2a2a2a;
}

.modal-header h3 {
    margin: 0;
    color: #ff0000;
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 3px;
}

.close-btn:hover {
    color: #ff0000;
    background: #222;
}

.modal-body {
    padding: 18px;
    color: #ddd;
}

.modal-body p {
    margin-top: 0;
    line-height: 1.5;
    font-size: 13px;
    color: #aaa;
}

.modal-example {
    background: #0a0a0a;
    padding: 10px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #ffff00;
    border: 1px solid #2a2a2a;
    margin: 10px 0;
}

.modal-body textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ddd;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: all 0.2s ease;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #ffff00;
    color: #ffff00;
    background: #0f0f0f;
}

.validation-message {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.validation-message.error {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff6666;
}

.validation-message.success {
    background: rgba(255, 255, 0, 0.15);
    border: 1px solid rgba(255, 255, 0, 0.4);
    color: #ffff00;
}

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 16px 18px;
    border-top: 1px solid #2a2a2a;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: #cc4444;
    color: #fff;
    border-color: #cc4444;
}

.modal-btn.primary:hover {
    background: #ff0000;
    border-color: #ff0000;
}

.modal-btn.secondary {
    background: transparent;
    border-color: #333;
    color: #aaa;
}

.modal-btn.secondary:hover {
    background: #2a2a2a;
    border-color: #444;
    color: #ddd;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .parameter-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .config-buttons {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* About Page Styles */
.about-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 30px;
}

.about-hero {
    text-align: center;
    margin: 2rem 0 3rem;
}

.about-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: none;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-family: 'Bungee Tint', cursive;
    font-size: 28px;
    color: #ff0000;
    margin: 0 0 1.5rem 0;
    font-weight: normal;
}

.about-content {
    color: #f5f5f0;
    line-height: 1.8;
}

.about-content p {
    margin: 0 0 1.2rem 0;
    font-size: 16px;
    color: #f5f5f0;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-list {
    margin: 1rem 0;
    padding-left: 2rem;
    color: #f5f5f0;
}

.about-list li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    font-size: 15px;
    color: #f5f5f0;
}

.tech-term {
    color: #ff0000;
    font-weight: 500;
}

.about-link {
    color: #ff0000;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.about-link:hover {
    color: #cc4444;
    border-bottom-color: #cc4444;
}

/* Active navigation link */
nav a.active {
    color: #ff0000;
    font-weight: 600;
}

/* Responsive design for about page */
@media (max-width: 768px) {
    .about-container {
        padding: 0 20px;
    }
    
    .about-section h2 {
        font-size: 24px;
    }
    
    .about-content {
        padding: 0;
    }
    
    .about-content p {
        font-size: 15px;
    }
    
    .about-list li {
        font-size: 14px;
    }
}