/* Vertical Stacks Rosary Layout - TIGHT SPACING */
.rosary-diagram-sidearms {
    position: relative;
    width: 180px;
    height: auto;
    margin: 0 auto;
    background: #fafafa;
    padding: 10px 0;
}

/* Center Medal */
.center-medal-section {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.center-medal-section .component-image {
    width: 80px;
    height: 90px;
}

/* Vertical Bead Stacks */
.rosary-arm {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.left-arm {
    top: 10px;
    left: 40px;
}

.right-arm {
    top: 10px;
    right: 40px;
}

.arm-beads {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bead-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bead {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.bead.hail-mary {
    background-color: #f8f8f8;
}

.bead.our-father {
    background-color: transparent;
    width: 26px;
    height: 26px;
}

/* Metal Connectors - Vertical between beads */
.metal-connector {
    width: 2px;
    height: 8px;
    background-color: #999999;
    flex-shrink: 0;
}

.metal-connector-small {
    width: 2px;
    height: 8px;
    background-color: #999999;
    flex-shrink: 0;
}

.metal-connector-long {
    width: 2px;
    height: 8px;
    background-color: #999999;
    flex-shrink: 0;
}

/* REMOVED: Horizontal metal connectors from center to bead stacks */

/* Crucifix Section */
.crucifix-section {
    position: relative;
    margin-top: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.connector-beads {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bead-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.component-image.crucifix-image {
    width: 130px;
    height: 190px;
}

.component-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.component-image .placeholder {
    width: 100%;
    height: 100%;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 10px;
    text-align: center;
    background: #f9f9f9;
}

/* Rosary Customizer Layout */
.rosary-customizer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.customizer-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.component-selector {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

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

.component-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.component-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.rosary-preview-area {
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.rosary-preview-container {
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #ddd;
    overflow: hidden;
    padding: 10px 0;
}

.design-controls {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.price-display {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #2c5aa0;
    font-weight: bold;
}

.save-design-section {
    display: block;
    margin: 20px 0;
    text-align: center;
}

#design-name {
    display: block;
    width: 80%;
    max-width: 300px;
    margin: 0 auto 15px auto;
    padding: 8px 12px;
    box-sizing: border-box;
}

#save-design-btn {
    display: inline-block;
}

.button {
    padding: 12px 24px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.button:hover {
    background: #1e3f73;
}

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

.button.alt {
    background: #d4af37;
}

.button.alt:hover {
    background: #b8860b;
}

.saved-designs-section {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.saved-designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.saved-design-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.saved-design-item .design-preview {
    transform: scale(0.7);
    transform-origin: top center;
    margin: -10px 0;
}

#loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 1000;
}

.spinner {
    text-align: center;
}

/* Visualizer button styles */
.visualizer-buttons-container {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.add-to-visualizer-btn {
    flex: 1;
    background: #2c5aa0;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.add-to-visualizer-btn:hover {
    background: #1e3f73;
}

.add-to-visualizer-btn:disabled {
    background: #28a745;
    cursor: not-allowed;
}

.go-to-visualizer {
    display: none;
    flex: 1;
    background: #d4af37;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.go-to-visualizer:hover {
    background: #b8860b;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .rosary-diagram-sidearms {
        width: 160px;
    }
    
    .left-arm {
        left: 30px;
    }
    
    .right-arm {
        right: 30px;
    }
    
    .customizer-container {
        grid-template-columns: 1fr;
    }
    
    .saved-designs-grid {
        grid-template-columns: 1fr;
    }
    
    .visualizer-buttons-container {
        flex-direction: column;
    }
}