/* Component Styles - Placeholder */
/* This will be populated with extracted styles from mangelrapport-unified.html */

/* For now, loading the extracted main.css has all styles */

/* ============================================
   Live Walkthrough Components
   ============================================ */

/* Live capture thumbnail grid */
.live-capture-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.live-capture-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.live-capture-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-capture-thumb-badges {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.badge-success {
    background: var(--accent);
}

/* Live categorization item */
.live-categorize-item {
    min-width: 100px;
    flex-shrink: 0;
    background: var(--surface);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.live-categorize-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.live-categorize-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.live-categorize-item.completed {
    opacity: 0.7;
    border-color: var(--accent);
}

.live-categorize-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.live-categorize-item-info {
    text-align: center;
}

.live-categorize-item-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.live-categorize-item-category {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Live capture pin badge */
.live-capture-pin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Error Message Component */
.error-message {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

.error-message strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #7f1d1d;
}

.error-message a {
    color: #991b1b;
    text-decoration: underline;
    font-weight: 500;
}

.error-message a:hover {
    color: #7f1d1d;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Validation Banner Component
   ============================================ */

.validation-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow:
        0 4px 6px -1px rgba(245, 158, 11, 0.1),
        0 2px 4px -1px rgba(245, 158, 11, 0.06),
        0 0 0 0 rgba(245, 158, 11, 0.4);
    animation: slideInDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: top center;
}

/* Smooth slide-in animation with bounce */
@keyframes slideInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulse animation for extra emphasis */
@keyframes pulse {
    0%, 100% {
        box-shadow:
            0 4px 6px -1px rgba(245, 158, 11, 0.1),
            0 2px 4px -1px rgba(245, 158, 11, 0.06),
            0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow:
            0 4px 6px -1px rgba(245, 158, 11, 0.1),
            0 2px 4px -1px rgba(245, 158, 11, 0.06),
            0 0 0 8px rgba(245, 158, 11, 0);
    }
}

.validation-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.validation-banner-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #d97706;
    margin-top: 2px;
}

.validation-banner-text {
    flex: 1;
    min-width: 0;
}

.validation-banner-title {
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
    line-height: 1.4;
}

.validation-banner-message {
    font-size: 14px;
    color: #78350f;
    line-height: 1.5;
    opacity: 0.9;
}

.validation-banner-dismiss {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #92400e;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: -8px -8px -8px 0;
    padding: 0;
}

.validation-banner-dismiss:hover {
    background: rgba(146, 64, 14, 0.1);
    color: #78350f;
}

.validation-banner-dismiss:active {
    transform: scale(0.95);
    background: rgba(146, 64, 14, 0.15);
}

/* Smooth fade-out animation */
@keyframes fadeOutUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
}

.validation-banner.dismissing {
    animation: fadeOutUp 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ============================================
   Floor Plan Upload Box - Highlighted State
   ============================================ */

.photo-box.validation-highlight {
    position: relative;
    animation: gentleShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    border-color: #f59e0b !important;
    box-shadow:
        0 0 0 3px rgba(245, 158, 11, 0.2),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

/* Gentle shake to draw attention */
@keyframes gentleShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Animated ring pulse effect */
.photo-box.validation-highlight::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    border: 2px solid #f59e0b;
    animation: ringPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes ringPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.02);
    }
}

/* Remove highlight when user interacts */
.photo-box.validation-highlight:hover::before,
.photo-box.validation-highlight:focus-within::before {
    animation: none;
    opacity: 0.6;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 640px) {
    .validation-banner {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .validation-banner-content {
        gap: 10px;
    }

    .validation-banner-title {
        font-size: 15px;
    }

    .validation-banner-message {
        font-size: 13px;
    }

    .validation-banner-dismiss {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* Focus states for keyboard navigation */
.validation-banner-dismiss:focus-visible {
    outline: 2px solid #d97706;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .validation-banner,
    .validation-banner.dismissing,
    .photo-box.validation-highlight,
    .photo-box.validation-highlight::before {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }

    .validation-banner {
        opacity: 1;
        transform: none;
    }
}

/* ================================================
   SUCCESS TOAST NOTIFICATION SYSTEM
   ================================================ */

/* Toast Container - Fixed positioning */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    width: 100%;
    max-width: 600px;
    padding: 0 16px;
}

/* Individual Toast */
.toast {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow:
        0 10px 25px rgba(5, 150, 105, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    pointer-events: auto;
    transform: translateY(-120%) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
}

/* Toast animation states */
.toast.toast-show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast.toast-hide {
    transform: translateY(-120%) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* Success Icon */
.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: toast-icon-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes toast-icon-pop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.toast-icon svg {
    width: 16px;
    height: 16px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Check animation */
.toast-icon svg path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: check-draw 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

@keyframes check-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.toast-message {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    transform-origin: left;
    animation: toast-progress 3s linear forwards;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ================================================
   BUTTON SUCCESS STATE
   ================================================ */

/* Success state for buttons */
.btn-primary.btn-saving {
    background: var(--secondary);
    pointer-events: none;
    position: relative;
    overflow: hidden;
}

.btn-primary.btn-saving::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

.btn-primary.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.02);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary.btn-success::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 24px;
    font-weight: bold;
    animation: btn-check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes btn-check-pop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Hide button text during success state */
.btn-primary.btn-saving .btn-text,
.btn-primary.btn-success .btn-text {
    opacity: 0;
}

/* ================================================
   MOBILE OPTIMIZATIONS (Toast)
   ================================================ */

@media (max-width: 600px) {
    .toast-container {
        top: 16px;
        padding: 0 12px;
    }

    .toast {
        padding: 14px 16px;
        border-radius: 10px;
    }

    .toast-title {
        font-size: 14px;
    }

    .toast-message {
        font-size: 12px;
    }
}

/* ================================================
   ACCESSIBILITY (Toast)
   ================================================ */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast-icon,
    .toast-icon svg path,
    .btn-primary.btn-success {
        animation: none;
        transition: opacity 0.2s ease-in-out;
    }

    .toast.toast-show {
        transform: translateY(0) scale(1);
    }

    .toast.toast-hide {
        transform: translateY(0) scale(1);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid white;
        box-shadow: none;
    }
}
