/* Color Variables */
:root {
    --primary-color: #DAA520;    /* Mustard Yellow - more vibrant */
    --secondary-color: #CD5C5C;  /* Burnt Orange */
    --accent-color: #1B9B9B;     /* Darker Teal */
    --sage-green: #9CAF88;       /* Sage Green - now background */
    --text-dark: #2c3e50;
    --text-medium: #4a4a4a;
    --text-light: #f8f9fa;
    --background-light: #f8f9fa;
    --background-dark: #34495e;
    --shadow: rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Century Gothic', 'Apple Gothic', 'AppleGothic', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--sage-green);
    min-height: 100vh;
}

.container {
    margin: 0 auto;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    border: 60px solid var(--sage-green);
    box-sizing: border-box;
}

/* Header */
.header {
    text-align: center;
    color: white;
    padding: 3rem 0 2rem;
    background: var(--sage-green);
}

.header h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(47, 79, 79, 0.3);
}

.tagline {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Tab Navigation */
.tab-container {
    background: var(--primary-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 2rem;
}

.tab-nav {
    display: flex;
    background: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    padding: 1.5rem 2rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-button.active {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(27, 155, 155, 0.4);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 3rem;
    min-height: 500px;
    animation: fadeIn 0.5s ease-in-out;
    background: #f8f9fa;
    margin: 1rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

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

/* Center content for About and Craft & Code tabs */
#about, #craft {
    text-align: center;
}

#about h1, #about h2, #about h3, #about p,
#craft h1, #craft h2, #craft h3, #craft p,
#craft .connection-item h4,
#craft .connection-item p {
    text-align: center;
}

/* About Section */
.about-content {
    text-align: center;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-medium);
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--background-light);
    border-radius: 15px;
    box-shadow: 0 4px 12px var(--shadow);
}

.profile-image {
    flex-shrink: 0;
    position: relative;
}

.profile-image img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 5px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--background-light);
}

.profile-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.profile-text {
    flex: 1;
    text-align: left;
}

.profile-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .profile-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .profile-text {
        text-align: center;
    }
    
    .profile-image img {
        width: 160px;
        height: 160px;
    }
}

.intro-highlight {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem !important;
}

.intro-bullets {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.intro-bullet {
    background: var(--background-light);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    color: var(--text-medium);
    border: 1px solid var(--primary-color);
}

.journey-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: var(--accent-color);
    border-radius: 12px;
    flex: 1;
    border: 2px solid var(--accent-color);
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.mission-statement {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--background-light), var(--background-sage));
    padding: 2rem;
    border-radius: 15px;
    margin: 3rem 0;
    text-align: center;
    border: 2px solid var(--primary-color);
}

.mission-icon {
    font-size: 2rem;
    margin-right: 1rem;
    color: var(--accent-color);
}

.mission-statement p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

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

.focus-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
    color: var(--accent-color);
}

.focus-highlights {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.highlight-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-medium);
    border-left: 3px solid var(--secondary-color);
}

.current-focus {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.focus-item {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.focus-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.focus-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.emoji-icon {
    font-style: normal;
    margin-right: 0.8rem;
    font-size: 1.3rem;
    display: inline-block;
    width: 1.5rem;
    text-align: center;
    filter: grayscale(100%) sepia(100%) saturate(10000%) hue-rotate(220deg) brightness(0.8);
}

/* Experience Section */
.experience-grid {
    display: grid;
    gap: 2rem;
}

.experience-item {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.job-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.company {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

.date {
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
}

.job-description {
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.achievements {
    list-style: none;
}

.achievements li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-dark);
    line-height: 1.6;
}

.achievements li:before {
    content: '▪';
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.achievements li strong {
    color: var(--secondary-color);
}

/* Education Section */
.education-grid {
    display: grid;
    gap: 2rem;
}

.education-item {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.education-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.degree {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.school {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.edu-details {
    color: var(--text-medium);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.skill-category h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.skill-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.skill-tag.product { background: var(--accent-color); }
.skill-tag.tech { background: var(--primary-color); }
.skill-tag.healthcare { background: var(--secondary-color); }

/* Craft & Code Section */
.craft-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.craft-connections {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.connection-section h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.connection-item {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.connection-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.connection-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-connection {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-connection:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.skill-pair strong {
    color: var(--accent-color);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.craft-benefits {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--primary-color);
    list-style: none;
}

.craft-benefits li {
    margin-bottom: 1rem;
    padding-left: 0;
}

.craft-benefits li strong {
    color: var(--secondary-color);
}

/* Pattern Generator Styles */
.pattern-generator {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--accent-color);
}

.upload-area {
    border: 3px dashed var(--accent-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(27, 155, 155, 0.05);
    max-width: 400px;
    margin: 0 auto 2rem auto;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(218, 165, 32, 0.05);
}

.upload-area.dragover {
    border-color: var(--secondary-color);
    background: rgba(205, 92, 92, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Image display styling */
.image-preview img {
    max-width: 600px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

.pattern-image canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 2px solid #333 !important;
    display: block;
    margin: 0 auto;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: white;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
}

.image-preview, .pattern-image {
    width: 100%;
}

.upload-note {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-top: 0.5rem;
}

.image-preview {
    margin-top: 2rem;
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.image-preview h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

#previewImage {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--accent-color);
}

.controls-section {
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dimensions-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.dimension-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dimension-control label {
    min-width: 120px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.control-group label {
    min-width: 140px;
    font-weight: 600;
    color: var(--text-dark);
}

.control-group input[type="range"] {
    flex: 1;
    accent-color: var(--accent-color);
}

/* Measurement Input Styles */
.dimensions-container {
    transition: all 0.3s ease;
}

.measurement-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.measurement-input {
    width: 60px;
    padding: 0.4rem;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.3s ease;
}

.gauge-input {
    width: 80px;
    padding: 0.4rem;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.3s ease;
}

.strand-input {
    width: 60px;
    padding: 0.4rem;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.3s ease;
}

.color-input {
    width: 60px;
    padding: 0.4rem;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.3s ease;
}

.measurement-input:focus,
.gauge-input:focus,
.strand-input:focus,
.color-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 155, 155, 0.1);
}

.measurement-input:invalid,
.gauge-input:invalid,
.strand-input:invalid,
.color-input:invalid {
    border-color: var(--secondary-color);
}

.unit-label {
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 500;
    min-width: 30px;
}

@media (max-width: 768px) {
    .measurement-inputs {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .measurement-input {
        width: 80px;
    }
}

.control-group span {
    min-width: 30px;
    font-weight: 600;
    color: var(--accent-color);
}

/* Toggle Control Styles */
.toggle-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.toggle-control input[type="checkbox"] {
    position: relative;
    width: 50px;
    height: 26px;
    appearance: none;
    background: #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-control input[type="checkbox"]:checked {
    background: var(--accent-color);
}

.toggle-control input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-control input[type="checkbox"]:checked::before {
    transform: translateX(24px);
}

.toggle-control label {
    cursor: pointer;
    min-width: auto;
    flex: 1;
}

.toggle-text {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.toggle-description {
    display: block;
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: normal;
}

/* Craft Control Styles */
.craft-select,
.yarn-select,
.thread-select,
.fabric-select,
.gauge-select {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.craft-select:focus,
.yarn-select:focus,
.thread-select:focus,
.fabric-select:focus,
.gauge-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 155, 155, 0.1);
}

.yarn-controls,
.thread-controls,
.fabric-controls,
.gauge-controls {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.yarn-controls.hidden,
.thread-controls.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.generate-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.generate-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.results-section {
    margin-top: 2rem;
}

.pattern-result {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
}

.pattern-image {
    text-align: center;
    /* Create a responsive viewport for the pattern */
    width: 90%;
    max-width: none;
    margin: 0 auto 2rem auto;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    background: #f5f5f5;
    padding: 10px;
    /* No scrolling on outer container */
    overflow: visible;
    position: relative;
}

.pattern-image h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.pattern-header {
    background: #f5f5f5;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
}

.pattern-header h4 {
    margin-bottom: 1rem;
}

/* Scrollable container for the pattern canvas */
.pattern-canvas-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    position: relative;
    /* Center the canvas content in non-edit mode */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Better scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) #f1f1f1;
    /* Ensure proper containment and clipping */
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    /* Prevent any overflow outside this container */
    contain: layout style paint;
}

/* Edit mode: enable scrolling with smaller max height and remove centering */
.pattern-canvas-container.edit-mode {
    max-height: 60vh;
    min-height: 400px;
    overflow: auto;
    display: block;
    justify-content: unset;
    align-items: unset;
}

/* Webkit scrollbar styling */
.pattern-canvas-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.pattern-canvas-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.pattern-canvas-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 6px;
}

.pattern-canvas-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

#patternCanvas {
    /* Remove responsive sizing - use fixed stitch size */
    max-width: none;
    width: auto;
    height: auto;
    border: none !important;
    display: block;
    margin: 0 auto;
    padding: 0;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: white;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -webkit-crisp-edges;
    /* Ensure canvas stays within container */
    box-sizing: border-box;
    position: relative;
    left: 0;
    top: 0;
}

.color-palette {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-palette h4 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.palette-colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.color-swatch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.color-swatch {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-swatch:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--primary-color);
}

.color-info {
    font-size: 0.7rem;
    color: var(--text-medium);
    text-align: center;
}

/* Color Picker Modal */
.color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.color-picker-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.color-picker-content h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.color-picker-section {
    margin-bottom: 1.5rem;
}

.color-picker-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.color-picker-section input[type="color"] {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.color-preview {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.current-color,
.new-color {
    flex: 1;
    text-align: center;
}

.current-color span,
.new-color span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.color-sample {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.color-picker-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.apply-btn,
.cancel-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.apply-btn {
    background: var(--primary-color);
    color: white;
}

.apply-btn:hover {
    background: #b8941c;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #e9ecef;
    color: var(--text-dark);
}

.cancel-btn:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.load-draft-section {
    text-align: center;
    margin-top: 1rem;
}

.load-draft-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-draft-btn:hover {
    background: #157a7a;
    transform: translateY(-2px);
}

.load-draft-btn:active {
    transform: translateY(0);
}

.save-btn {
    background: var(--accent-color) !important;
}

.save-btn:hover {
    background: #157a7a !important;
}

.draft-management-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #e8f4fd;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    text-align: center;
}

.draft-management-section h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.draft-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.draft-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draft-btn:hover {
    background: #157a7a;
    transform: translateY(-2px);
}

.draft-btn:active {
    transform: translateY(0);
}

.auto-save-indicator {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
}

.status-text {
    padding: 0.25rem 0.5rem;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Draft Modal Styles */
.draft-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.draft-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.draft-modal-header {
    background: var(--accent-color);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.draft-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.draft-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.draft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.draft-item:hover {
    border-color: var(--accent-color);
    background: #e8f4fd;
}

.draft-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.draft-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #666;
}

.draft-actions {
    display: flex;
    gap: 0.5rem;
}

.load-draft-btn, .delete-draft-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-draft-btn {
    background: var(--accent-color);
    color: white;
}

.load-draft-btn:hover {
    background: #157a7a;
}

.delete-draft-btn {
    background: var(--secondary-color);
    color: white;
}

.delete-draft-btn:hover {
    background: #b94545;
}

/* Toast Notification Styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-info {
    background: var(--accent-color);
}

.export-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.export-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-name-input {
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.project-name-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.project-name-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.project-name-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.1);
}

.export-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.export-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.export-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.export-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.gridline-options {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.gridline-options label {
    color: var(--text-color);
    font-weight: 500;
}

.gridline-options input {
    padding: 0.3rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.gridline-options span {
    color: var(--text-color);
}

/* Material Estimates Styles */
.material-estimates {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 5px solid var(--accent-color);
}

.material-estimates h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-align: center;
}

.project-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-weight: 600;
    color: var(--text-dark);
}

.info-item span:last-child {
    color: var(--accent-color);
    font-weight: 600;
}

.material-list {
    display: grid;
    gap: 0.75rem;
}

.material-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid;
}

.material-color {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.material-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.material-details {
    display: flex;
    flex-direction: column;
}

.material-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.material-rgb {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.material-amount {
    text-align: right;
}

.material-yardage {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.material-stitches {
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-top: 0.2rem;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.contact-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 140px;
}

.contact-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .tab-content {
        padding: 2rem 1.5rem;
    }
    
    .tab-button {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .job-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .current-focus {
        grid-template-columns: 1fr;
    }
    
    .image-comparison {
        grid-template-columns: 1fr;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dimensions-row {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .dimension-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        width: 100%;
    }
    
    .dimension-control label {
        min-width: auto;
    }
}

/* Smooth transitions */
.tab-content * {
    transition: all 0.3s ease;
}

/* Stitch Color Picker Modal */
.stitch-color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(3px);
}

.stitch-color-picker-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.stitch-color-picker-content h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.2rem;
}

.stitch-color-options {
    margin-bottom: 1.5rem;
}

.palette-selection,
.custom-color-selection {
    margin-bottom: 1.5rem;
}

.palette-selection h5,
.custom-color-selection h5 {
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
    margin-bottom: 1rem;
}

.palette-color-option {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.palette-color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.palette-color-option.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.3);
}

.palette-color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.custom-color-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#stitchCustomColor {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.add-custom-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.add-custom-btn:hover {
    background: #e6a015;
}

.stitch-color-preview {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.current-stitch,
.new-stitch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.current-stitch span,
.new-stitch span {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 500;
}

.stitch-sample {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stitch-color-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.stitch-color-buttons .apply-btn,
.stitch-color-buttons .cancel-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.stitch-color-buttons .apply-btn {
    background: var(--primary-color);
    color: white;
}

.stitch-color-buttons .apply-btn:hover {
    background: #1a365d;
}

.stitch-color-buttons .cancel-btn {
    background: #6c757d;
    color: white;
}

.stitch-color-buttons .cancel-btn:hover {
    background: #545b62;
}

/* Edit Mode Styles */
.pattern-controls {
    margin-bottom: 1rem;
    text-align: center;
}

.edit-mode-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.edit-mode-btn:hover {
    background: #157a7a;
    transform: translateY(-1px);
}

.edit-mode-btn.active {
    background: var(--secondary-color);
}

.edit-mode-btn.active:hover {
    background: #b8494b;
}

.edit-instructions {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #e8f4f8;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    text-align: center;
    color: var(--text-dark);
}

.edit-instructions p {
    margin: 0;
    font-size: 0.9rem;
}

.edit-color-palette {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.edit-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.edit-color-swatch:hover {
    transform: scale(1.1);
    border-color: var(--text-dark);
}

.edit-color-swatch.selected {
    border-color: var(--primary-color);
    border-width: 4px;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
}

.add-color-section {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#newColorPicker {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.add-color-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-color-btn:hover {
    background: #157a7a;
    transform: translateY(-1px);
}

.row-column-controls {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

.row-column-controls h5 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1rem;
    text-align: center;
}

.dimension-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.control-group label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 60px;
}

.dimension-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--accent-color);
    color: white;
}

.dimension-btn:hover {
    background: #157a7a;
    transform: translateY(-1px);
}

.dimension-btn.delete {
    background: var(--secondary-color);
}

.dimension-btn.delete:hover {
    background: #b94545;
}

.dimension-instructions {
    margin: 1rem 0 0 0;
    text-align: center;
    color: #666;
    font-style: italic;
}

.add-color-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Canvas edit mode styles */
#patternCanvas.edit-mode {
    cursor: crosshair !important;
    border: 2px solid var(--secondary-color);
}

#patternCanvas.edit-mode:hover {
    border-color: var(--primary-color);
}

/* Pattern canvas hover effects */
#patternCanvas:hover {
    border-color: var(--accent-color);
}
