/* Step indicator styles */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-weight: bold;
}

.step.active .step-circle {
    background-color: #3b82f6;
    color: white;
}

.step-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.step.active .step-text {
    color: #3b82f6;
}

.step-line {
    width: 100px;
    height: 2px;
    background-color: #e5e7eb;
    margin: 0 1rem;
}

.step.active + .step-line {
    background-color: #3b82f6;
}

/* Upload zone styles */
.upload-zone {
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.upload-zone.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Template preview styles */
.template-preview {
    max-width: 800px;
    margin: 0 auto;
}

/* Draggable element styles */
.draggable-element {
    position: absolute;
    cursor: move;
    padding: 4px 8px;
    border: 1px dashed #999;
    background: rgba(255,255,255,0.8);
    min-width: 35px;
    text-align: center;
    user-select: none;
    font-size: 12px;
    touch-action: none;
    z-index: 100;
    box-sizing: border-box;
}

.draggable-element#invitee_name {
    width: 726px;
    text-align: center;
    border: 1px dashed #3b82f6;
}

.draggable-element:hover {
    background-color: rgba(59, 130, 246, 0.3);
}

/* Position Configuration Styles */
#position-config-container {
    min-height: 400px;
}

.template-container {
    position: relative;
    border: 1px solid #ccc;
    margin: 20px 0;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.template-container img {
    display: block;
    width: 100%;
    height: auto;
}

.element-toolbar {
    width: 200px;
    z-index: 100;
}

.draggable-element {
    border: 2px solid;
    transition: all 0.2s ease;
}

.draggable-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.draggable-element.dragging {
    opacity: 0.7;
    transform: scale(1.05);
}

.positioned-element {
    position: absolute;
    padding: 8px;
    border: 2px solid;
    border-radius: 4px;
    min-width: 100px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: move;
    z-index: 50;
    transition: background-color 0.2s ease;
}

.positioned-element:hover {
    z-index: 51;
}

.canvas-container {
    border: 1px solid #ccc;
    margin: 20px 0;
    position: relative;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 54mm;
    height: 85.6mm;
}

.draggable {
    position: absolute;
    cursor: move;
    padding: 2px;
    border: 1px dashed #999;
    background: rgba(255,255,255,0.8);
    min-width: 35px;
    text-align: center;
    user-select: none;
    font-size: 9px;
    touch-action: none;
}

.coordinate-display {
    position: absolute;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    pointer-events: none;
    display: none;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    margin-bottom: 2px;
}

.draggable-element:hover .coordinate-display,
.draggable-element:active .coordinate-display {
    display: block;
}

#nameElement {
    font-weight: bold;
    font-size: 9px;
}

/* Invitee Management Styles */
.event-selection {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.event-selection .custom-radio {
    margin-bottom: 10px;
}

.event-selection #newEventSection {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.upload-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.upload-section.visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.upload-section .alert {
    margin-bottom: 20px;
}

.invitee-list {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.invitee-item {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.invitee-item:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.invitee-item img {
    margin-top: 10px;
    border: 1px solid #ddd;
    padding: 5px;
    background: white;
    border-radius: 4px;
}

#step3 h4 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.text-danger {
    color: #dc3545;
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Specific element styles */
#invitee_name {
    min-width: 80px;
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

#qr_code {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(72, 187, 120, 0.1);
    border-color: #48bb78;
}

#card_type {
    min-width: 60px;
    background: rgba(236, 153, 72, 0.1);
    border-color: #ec9948;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Card Generator Styles */
.card-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.card-row .form-control,
.card-row .form-select {
    flex: 1;
}

.card-row .btn-danger {
    flex: 0 0 auto;
}

#progress-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.progress {
    height: 25px;
    border-radius: 5px;
    background-color: #f0f0f0;
}

.progress-bar {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    line-height: 25px;
    font-weight: bold;
}

/* Generated Cards Section */
#card-list .mt-4 {
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 20px;
}

#card-list .mt-4 h4 {
    margin-bottom: 15px;
    color: #333;
}

#card-list .mt-4 .mb-2 {
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: background-color 0.2s;
}

#card-list .mt-4 .mb-2:hover {
    background-color: #f0f0f0;
}

#card-list .mt-4 .btn-link {
    font-weight: 500;
    text-decoration: none;
}

#card-list .mt-4 .btn-outline-secondary {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.step-content {
    display: block;
}

.step-content.hidden {
    display: none !important;
}

/* Styling panel */
#style-panel {
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    max-height: 80vh;
    overflow: hidden;
    min-width: 250px;
    min-height: 300px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#style-panel.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.panel-content {
    overflow-y: auto;
    height: calc(100% - 2.5rem); /* Subtract the handle height */
    padding-right: 5px;
}

.panel-handle {
    cursor: move;
    user-select: none;
}

/* Font preview */
.font-preview-container {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    min-height: 40px;
    text-align: center;
}

/* Make the positioning boxes smaller and simpler */
.draggable-element {
    min-width: 30px;
    min-height: 20px;
    font-size: 11px;
    padding: 2px 4px;
}

.coordinate-display {
    font-size: 9px;
    color: #666;
}

/* Font size slider */
.font-size-slider {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.font-size-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

.font-size-display {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

/* Floating Style Panel Styles */
#style-panel {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
    /* Start hidden initially */
    transform: translateX(100%);
}

#style-panel.panel-visible {
    transform: translateX(0);
}

#toggle-style-panel {
    transition: all 0.3s ease;
}

#toggle-style-panel:hover {
    transform: rotate(30deg);
}

/* Draggable handle for style panel */
.panel-handle {
    cursor: move;
    padding: 8px;
    margin: -8px;
}

/* For mobile screens, make the panel full width */
@media (max-width: 640px) {
    #style-panel {
        right: 0;
        width: 90% !important;
        max-width: 100%;
        left: 50%;
        transform: translateX(100%);
    }

    #style-panel.panel-visible {
        transform: translateX(-50%);
    }
}

/* Sidebar styles */
#sidebar {
    z-index: 40;
    width: 260px;
    overflow-y: auto;
}

#sidebar.open {
    transform: translateX(0);
}

.content-with-sidebar {
    transition: margin-left 0.3s ease;
    margin-left: 260px;
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

@media (max-width: 768px) {
    .content-with-sidebar {
        margin-left: 0;
    }
    
    #sidebar {
        width: 240px;
    }
    
    #sidebar-toggle {
        display: block;
    }
}
