/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background: white;
    min-height: 100vh;
}

/* Header */
.header {
    padding: 15px 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-text {
    text-align: center;
    flex: 1;
}

.header-text h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.header-text p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.interface-toggle-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.interface-toggle-btn:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.interface-toggle-btn:active {
    transform: scale(0.98);
}

.interface-toggle-btn .icon {
    font-size: 16px;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 20px;
    padding: 0 20px;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-title {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: #4a90e2;
    color: white;
}

.progress-step.active .step-title {
    color: #4a90e2;
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: #28a745;
    color: white;
}

.progress-step.completed .step-title {
    color: #28a745;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Panels */
.left-panel {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
}

.right-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

/* Step Content */
.step-content {
    display: none;
}

.step-content h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

.step-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Marker Style Selection */
.marker-styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.marker-style-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.marker-style-card:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.marker-style-card.selected {
    border-color: #4a90e2;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.marker-image-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.marker-image {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.marker-style-card h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.marker-style-card p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.marker-style-card small {
    color: #999;
    font-size: 11px;
    font-style: italic;
}

.marker-style-card[data-style="upright"] small {
    color: #e67e22;
    font-weight: 500;
}

/* Size Option Cards */
.size-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.size-option-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.size-option-card:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.size-option-card.active {
    border-color: #4a90e2;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.size-visual {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.size-rectangle {
    background: #666;
    border-radius: 2px;
    position: relative;
    border: 3px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.size-rectangle.size-16x8 {
    width: 32px;
    height: 16px;
}

.size-rectangle.size-20x10 {
    width: 40px;
    height: 20px;
}

.size-rectangle.size-24x12 {
    width: 48px;
    height: 24px;
}

.size-rectangle.size-36x12 {
    width: 60px;
    height: 20px;
}

.size-option-card.active .size-rectangle {
    border-color: #4a90e2;
    box-shadow: 0 3px 6px rgba(74, 144, 226, 0.3);
}

.size-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.size-info p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Color Option Cards */
.color-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.color-option-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.color-option-card:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.color-option-card.active {
    border-color: #4a90e2;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.color-preview-container {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin: 0 auto 15px;
    border: 1px solid #ccc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.color-preview-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}

.color-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.color-info p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Layout Options */
.layout-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.layout-option-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.layout-option-card:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.layout-option-card.active {
    border-color: #4a90e2;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.layout-preview {
    width: 120px;
    height: 80px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 auto 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    font-size: 8px;
    color: #666;
    line-height: 1.2;
}

.layout-preview .text-line {
    background: #4a90e2;
    height: 2px;
    margin: 2px 0;
    border-radius: 1px;
}

.layout-preview .name-line {
    width: 80%;
    background: #2c3e50;
    height: 3px;
}

.layout-preview .date-line {
    width: 60%;
}

.layout-preview .message-line {
    width: 70%;
}

.layout-preview .spouse-line {
    width: 75%;
    background: #34495e;
}

/* Companion layout specific */
.layout-preview.companion {
    height: 100px;
}

.layout-preview.side-by-side {
    flex-direction: row;
    justify-content: space-around;
}

.layout-preview.side-by-side .person {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.layout-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.layout-info p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.text-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.companion-only {
    transition: all 0.3s ease;
}

.section {
    margin-bottom: 20px;
}

.section h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Buttons */
.option-btn, .category-btn, .tab-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 5px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-btn:hover, .category-btn:hover, .tab-btn:hover {
    background: #f0f8ff;
    border-color: #4a90e2;
}

.option-btn.active, .category-btn.active, .tab-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Color Swatches */
.color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ccc;
    display: inline-block;
}

.color-swatch.black { background-color: #2c2c2c; }
.color-swatch.gray { background-color: #808080; }
.color-swatch.red { background-color: #8b4513; }

/* Size Select */
.size-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

/* Art Categories */
.art-categories {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-btn {
    font-size: 11px;
    padding: 6px 10px;
}

/* Position Tabs */
.position-tabs {
    display: flex;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 6px 8px;
}

/* Art Gallery */
.art-gallery {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background: white;
}

.art-placeholder {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 12px;
}

.art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.art-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    text-align: center;
}

.art-item:hover {
    border-color: #4a90e2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.art-item img {
    width: 100%;
    height: 50px;
    object-fit: contain;
    margin-bottom: 3px;
}

.art-item .art-name {
    font-size: 9px;
    color: #666;
}

/* Preview Container */
.preview-container {
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    transition: all 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    text-align: left;
}

.preview-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.toggle-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    color: #6c757d;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toggle-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.toggle-btn:active {
    transform: scale(0.95);
}

.stone-preview {
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
    min-height: 200px;
}

.stone-base {
    width: 300px;
    height: 200px;
    background: #2c2c2c;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    overflow: hidden;
}

.stone-base.gray { background: #808080; }
.stone-base.red { background: #8b4513; }

.art-layer {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;
}

.art-layer.top {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 40px;
}

.art-layer.middle {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 60px;
}

.art-layer.side-left {
    top: 30%;
    left: 10px;
    width: 40px;
    height: 60px;
}

.art-layer.side-right {
    top: 30%;
    right: 10px;
    width: 40px;
    height: 60px;
}

.text-layer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    width: 90%;
    height: 60%;
    display: flex;
    flex-direction: column;
}

.text-content {
    line-height: 1.2;
}

/* Bottom Panel */
.bottom-panel {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.text-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 12px;
    color: #555;
    margin-bottom: 3px;
    font-weight: 500;
}

.input-group input, .input-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.input-group small {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    display: block;
}

/* Navigation Panel */
.navigation-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

/* Final Actions */
.final-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Design Summary */
.design-summary {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    font-size: 13px;
    line-height: 1.5;
}

/* Preview Info */
.preview-info {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.preview-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Option Icons */
.option-icon {
    font-size: 18px;
    margin-right: 8px;
}

.option-btn {
    justify-content: flex-start;
    text-align: left;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 350px;
        gap: 15px;
    }
    
    .left-panel, .right-panel {
        padding: 15px;
    }
    
    .stone-base {
        width: 280px;
        height: 187px;
    }
    
    .progress-bar {
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .right-panel {
        position: static;
        order: -1;
    }
    
    .text-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .navigation-panel {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 200px;
    }
    
    .progress-bar {
        max-width: 400px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .step-title {
        font-size: 11px;
    }
}

/* Custom Scrollbar */
.art-gallery::-webkit-scrollbar {
    width: 6px;
}

.art-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.art-gallery::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.art-gallery::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Full-width preview styles */
.container.full-width-preview .main-content {
    grid-template-columns: 1fr;
}

.container.full-width-preview .left-panel {
    display: none;
}

.container.full-width-preview .right-panel {
    max-width: none;
    width: 100%;
}

.container.full-width-preview .preview-container {
    max-width: 1200px;
    margin: 0 auto;
}

.container.full-width-preview .stone-preview {
    max-width: 800px;
    margin: 0 auto;
}

.container.full-width-preview .stone-base {
    max-width: 100%;
    max-height: 600px;
}

/* Interface full-width styles */
.container.full-width-interface {
    max-width: none;
    padding: 10px 20px;
}

.container.full-width-interface .main-content {
    grid-template-columns: 30% 70%;
    gap: 30px;
    max-width: none;
}

.container.full-width-interface .header-content {
    max-width: 1400px;
    margin: 0 auto;
}

.container.full-width-interface .progress-container {
    max-width: 1400px;
    margin: 0 auto 20px;
}

.container.full-width-interface .navigation-panel {
    max-width: 1400px;
    margin: 20px auto 0;
}

.container.full-width-interface .stone-base {
    width: 450px !important;
    height: 300px !important;
}

.container.full-width-interface .preview-container {
    padding: 30px;
}

/* Text Layout Selection Styles (Step 2) */
.layout-options {
    margin-bottom: 30px;
}

.layout-options h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.layout-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.layout-option-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.layout-option-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.layout-option-card.active {
    border-color: #2980b9;
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4fd 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
}

.layout-option-card.active::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    background: #2980b9;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.layout-preview {
    height: 80px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.layout-preview.companion {
    height: 100px;
}

.layout-preview.side-by-side {
    display: flex;
    gap: 10px;
}

.layout-preview .person {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-line {
    background: #cbd5e1;
    height: 3px;
    border-radius: 2px;
    width: 100%;
    margin-bottom: 4px;
}

.text-line.name-line {
    background: #3b82f6;
    height: 4px;
}

.text-line.date-line {
    background: #64748b;
    width: 75%;
}

.text-line.message-line {
    background: #10b981;
    width: 90%;
}

.text-line.spouse-line {
    background: #8b5cf6;
    height: 4px;
}

.layout-info h4 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 600;
}

.layout-info p {
    color: #666;
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Text Input Styles for Step 2 */
.text-inputs {
    display: grid;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.input-group input,
.input-group textarea,
.input-group select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: white;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.companion-only {
    display: none;
}

.companion-inputs {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 10px;
}

.companion-inputs h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1em;
    font-weight: 600;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Text Positioning Styles */
.positioning-toggle {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 5px;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-text {
    font-weight: 600;
    color: #2c3e50;
}

.positioning-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.positioning-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
}

.positioning-info p {
    margin: 0;
    color: #1565c0;
    font-size: 0.9em;
}

.position-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.position-control-group {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

.position-control-group h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 0.95em;
    font-weight: 600;
}

.position-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.position-inputs label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #495057;
}

.position-inputs input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.position-inputs input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.position-inputs input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.positioning-actions {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

/* Draggable text elements */
.text-layer.positioning-mode {
    position: relative;
}

.draggable-text {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    user-select: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.draggable-text:hover {
    background-color: rgba(52, 152, 219, 0.4) !important;
    border-color: rgba(52, 152, 219, 0.8) !important;
    transform: translate(-50%, -50%) scale(1.05);
}

.draggable-text:active {
    background-color: rgba(52, 152, 219, 0.6) !important;
    border-color: rgba(52, 152, 219, 1) !important;
}

.name-text {
    font-size: 14px;
    font-weight: bold;
}

.date-text {
    font-size: 11px;
}

.message-text {
    font-size: 10px;
    font-style: italic;
}

.spouse-text {
    font-size: 13px;
    font-weight: bold;
}

.spouse-date-text {
    font-size: 10px;
}

/* Positioning grid overlay */
.positioning-grid {
    border-radius: 8px;
}

/* Positioning overlay */
.positioning-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Enhanced draggable text styles */
.draggable-text {
    position: absolute;
    cursor: move;
    padding: 4px 8px;
    border: 1px dashed rgba(255, 255, 255, 0.7);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    z-index: 1000;
    user-select: none;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Font Selection Styles (Step 3) */
.font-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.font-preview-section {
    margin: 25px 0;
}

.font-preview-section h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.font-preview-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    min-height: 120px;
}

.preview-sample {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.preview-alphabet {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* Font family classes */
.serif-font {
    font-family: 'Times New Roman', Times, serif;
}

.sans-serif-font {
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.script-font {
    font-family: 'Brush Script MT', cursive;
    font-style: italic;
}

.georgia-font {
    font-family: 'Georgia', serif;
}

.helvetica-font {
    font-family: 'Helvetica', 'Arial', sans-serif;
}

.garamond-font {
    font-family: 'Garamond', serif;
}

.trebuchet-font {
    font-family: 'Trebuchet MS', sans-serif;
}

.courier-font {
    font-family: 'Courier New', monospace;
}

.palatino-font {
    font-family: 'Palatino', serif;
}

.verdana-font {
    font-family: 'Verdana', sans-serif;
}

/* Font size classes */
.font-size-small .preview-sample {
    font-size: 18px;
}

.font-size-small .preview-alphabet {
    font-size: 12px;
}

.font-size-medium .preview-sample {
    font-size: 24px;
}

.font-size-medium .preview-alphabet {
    font-size: 14px;
}

.font-size-large .preview-sample {
    font-size: 30px;
}

.font-size-large .preview-alphabet {
    font-size: 16px;
}

.font-size-extra-large .preview-sample {
    font-size: 36px;
}

.font-size-extra-large .preview-alphabet {
    font-size: 18px;
}

/* Custom font size classes */
.font-size-custom .preview-sample {
    /* Font size will be set dynamically via JavaScript */
}

.font-size-custom .preview-alphabet {
    /* Font size will be set dynamically via JavaScript (0.6x of preview-sample) */
}

/* Custom font size input styling */
.custom-font-size-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.custom-font-size-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}

.custom-size-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.custom-size-controls input[type="number"] {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    background: white;
    transition: border-color 0.3s ease;
    max-width: 100px;
}

.custom-size-controls input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.unit-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    min-width: 25px;
}

.custom-font-size-group small {
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
}

/* Terms of Endearment Styles */
.endearment-selection {
    margin: 20px 0;
}

.endearment-selection select,
.endearment-selection input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    background: white;
}

.endearment-selection select:focus,
.endearment-selection input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Text Preview Box */
.text-preview-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px 20px;
    margin: 20px 0;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-text {
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
}

.preview-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.preview-dates {
    font-size: 14px;
    margin-bottom: 12px;
    color: #555;
}

.preview-endearment {
    font-size: 14px;
    font-style: italic;
    margin-bottom: 8px;
    color: #666;
}

.preview-message {
    font-size: 13px;
    color: #777;
    margin-top: 8px;
}

/* Font-specific preview styles */
.preview-text.serif-font {
    font-family: 'Times New Roman', Times, serif;
}

.preview-text.sans-serif-font {
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.preview-text.script-font {
    font-family: 'Brush Script MT', cursive;
}

/* Step 3 specific input styling */
#step3 .input-group input,
#step3 .input-group textarea,
#step3 .input-group select {
    font-size: 1em;
    padding: 12px 16px;
}

#step3 .input-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* Responsive adjustments for layout cards */
@media (max-width: 768px) {
    .layout-options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .layout-option-card {
        padding: 15px;
    }
    
    .layout-preview {
        height: 60px;
    }
    
    .layout-preview.companion {
        height: 80px;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .position-controls-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
