/* Logo Area Selector Styles */

#logo-area-selector-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none; /* Toggled by JS */
    justify-content: center;
    align-items: center;
}

.logo-area-content {
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 85vw;
    height: 85vh;
    max-width: 1200px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logo-area-header {
    padding: 16px;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
}

.logo-area-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.logo-area-title h3 {
    margin: 0;
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 140%;
    color: #48505f;
}

.logo-area-help-text {
    font-family: "Noto Sans KR", sans-serif;
    font-size: 13px;
    line-height: 18px;
    color: #48505f;
}

.logo-area-close-btn {
    display: none; /* Hidden in new design */
}

.logo-area-swiper-container {
    width: 100%;
    height: 100%;
    flex: 1;
    background-color: #525659;
    position: relative; /* For absolute nav buttons */
    overflow: hidden !important; /* Ensure no slide bleeding */
}

/* Custom Navigation Buttons */
.custom-swiper-button-prev,
.custom-swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; /* Increased size */
    height: 44px; /* Increased size */
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000; /* Highest priority, above overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.custom-swiper-button-prev:hover,
.custom-swiper-button-next:hover {
    background-color: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}

.custom-swiper-button-prev {
    left: 20px;
}

.custom-swiper-button-next {
    right: 20px;
}

/* Swiper Logic handles disabled state, we can style it */
.swiper-button-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Dot Pagination Styles - positioned between swiper and footer */
.logo-area-pagination {
    position: relative !important;
    width: 100%;
    padding: 16px 0;
    background-color: #252627;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.logo-area-pagination .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    background-color: #cecfcf !important;
    opacity: 1 !important;
    margin: 0 !important;
    cursor: pointer;
    transition: background-color 0.2s;
}

.logo-area-pagination .swiper-pagination-bullet-active {
    background-color: #1976d2 !important;
}

.logo-area-footer {
    padding: 16px;
    background-color: white;
    display: flex;
    justify-content: stretch;
    gap: 10px;
    flex-shrink: 0;
}

.logo-area-btn-clear {
    flex: 1;
    height: 42px;
    padding: 0 24px;
    border: 1px solid #1a6dff;
    border-radius: 8px;
    background-color: white;
    color: #1a6dff;
    font-family: "Noto Sans KR", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.logo-area-btn-clear:hover {
    background-color: #f0f6ff;
}

.logo-area-btn-save {
    flex: 1;
    height: 42px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background-color: #1a6dff;
    color: white;
    font-family: "Noto Sans KR", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.logo-area-btn-save:hover {
    background-color: #1557cc;
}

/* Swiper Slide Content */
.logo-area-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100% !important;
    overflow: hidden;
}

.logo-area-content-box {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-area-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-area-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10;
}

/* Selection Rectangle */
.logo-area-rect {
    position: absolute;
    border: 2px solid #00d348;
    background-color: rgba(0, 211, 72, 0.2);
    box-sizing: border-box;
    z-index: 20;
}

.logo-area-del-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background-color: red;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 22px;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-area-temp-rect {
    border: 2px dashed red;
    background-color: rgba(255, 0, 0, 0.1);
    position: absolute;
    pointer-events: none;
}

/* AI Status Widget & Toast Styles */
#ai-status-widget {
    position: fixed;
    bottom: 0;
    right: 90px; /* Moved left to avoid chat icon */
    width: 320px;
    background: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px 8px 0 0;
    z-index: 10001;
    font-family: "Noto Sans KR", sans-serif;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e1e1e1;
    display: none; /* Hidden by default */
}

#ai-status-widget.visible {
    display: block;
}

#ai-status-widget.minimized {
    transform: translateY(calc(100% - 42px));
}

.widget-header {
    padding: 12px 15px;
    background: #343a40;
    color: white;
    border-radius: 7px 7px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.widget-controls button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0 5px;
    font-size: 16px;
}
.widget-controls button:hover {
    color: white;
}

.widget-body {
    max-height: 350px;
    overflow-y: auto;
    background: #fff;
    padding-bottom: 5px;
}

.status-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
}
.status-item:last-child {
    border-bottom: none;
}

.item-icon {
    margin-right: 12px;
    min-width: 20px;
    padding-top: 2px;
    display: flex;
    justify-content: center;
}

.item-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
}

@keyframes ai-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.item-success-icon {
    color: #28a745;
    font-style: normal;
    font-size: 16px;
}
.item-error-icon {
    color: #dc3545;
    font-style: normal;
    font-size: 16px;
}

.item-content {
    flex: 1;
    overflow: hidden;
}

.item-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-message {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

.item-progress-track {
    height: 6px;
    background: #e9ecef;
    margin-top: 8px;
    border-radius: 3px;
    overflow: hidden;
}

.item-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    transition: width 0.3s ease-out;
    border-radius: 3px;
}

/* Toast Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    width: 320px;
    animation: toast-slideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-left: 4px solid #ccc;
}

.toast.info {
    border-left-color: #17a2b8;
}
.toast.success {
    border-left-color: #28a745;
}
.toast.error {
    border-left-color: #dc3545;
}

.toast-content {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.toast-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

@keyframes toast-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Overlay Styles */
.logo-area-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(37, 38, 39, 0.7); /* Match dark background */
    z-index: 2000;
    display: none; /* Toggled by JS */
    justify-content: center;
    align-items: center;
}

.logo-area-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo-area-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a6dff;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
}

.logo-area-loading-text {
    font-family: "Noto Sans KR", sans-serif;
    font-size: 14px;
    color: #cecfcf; /* Lighter text for dark background */
    font-weight: 500;
}
