/**
 * Custom Jewelry AI - Frontend Styles
 */

.cja-designer {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
}

.cja-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cja-step {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.cja-step-title {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* Option buttons (jewelry type, material, style) */
.cja-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cja-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.cja-option:hover {
    border-color: #999;
    background: #f9f9f9;
}

.cja-option input {
    margin: 0;
}

.cja-option input:checked + span,
.cja-option input:checked ~ .cja-style-label {
    font-weight: 600;
}

.cja-option:has(input:checked) {
    border-color: #2c5aa0;
    background: #e8f0fe;
}

/* Design style options - image-based feel with icons */
.cja-style-option {
    flex-direction: column;
    min-width: 90px;
    text-align: center;
}

.cja-style-icon {
    font-size: 1.5rem;
    color: #555;
}

.cja-style-label {
    font-size: 0.85rem;
}

/* Gemstone search */
.cja-gemstone-search {
    position: relative;
}

.cja-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.cja-input:focus {
    outline: none;
    border-color: #2c5aa0;
}

.cja-gemstone-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.cja-gemstone-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

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

.cja-gemstone-item:hover {
    background: #f5f5f5;
}

.cja-gemstone-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.cja-gemstone-item .cja-gemstone-name {
    font-weight: 500;
}

.cja-selected-gemstone {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #e8f0fe;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cja-selected-gemstone img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

/* Buttons */
.cja-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
}

.cja-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cja-btn-primary {
    background: #2c5aa0;
    color: #fff;
}

.cja-btn-primary:hover:not(:disabled) {
    background: #234a85;
}

.cja-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.cja-btn-secondary:hover {
    background: #e5e5e5;
}

/* Result area */
.cja-result {
    margin-top: 1.5rem;
}

.cja-result-image-wrap {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.cja-result-image-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
}

.cja-result-actions {
    display: flex;
    gap: 0.75rem;
}

/* Loading state */
.cja-loading {
    text-align: center;
    padding: 2rem;
}

.cja-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #2c5aa0;
    border-radius: 50%;
    animation: cja-spin 0.8s linear infinite;
}

@keyframes cja-spin {
    to { transform: rotate(360deg); }
}

.cja-loading p {
    margin: 1rem 0 0;
    color: #666;
}

/* Error message */
.cja-error {
    margin-top: 1rem;
    padding: 1rem;
    background: #fde8e8;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
}
