/* === ОБЕРТКА И ТЕКСТ === */
.ts-wrapper {
    background-color: #fae5cf;
    color: #495057;
    font-family: inherit;
    border-radius: 8px;
    padding: 24px;
    box-sizing: border-box;
    width: 100%;
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    line-height: 1.5;
    margin-bottom: 30px;
}

.ts-info-box {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}
.ts-info-title {
    margin-top: 0; margin-bottom: 10px; font-size: 18px; color: #343a40; text-transform: uppercase; font-weight: 700;
}
.ts-info-list { margin: 0 0 15px 0; padding-left: 20px; font-size: 14px; }
.ts-privacy-notice {
    display: flex; align-items: center; gap: 10px; font-size: 13px; color: #2b7a0b;
    background-color: rgba(43, 122, 11, 0.1); padding: 10px 15px; border-radius: 6px; border-left: 4px solid #2b7a0b;
}

.ts-header {
    display: flex; align-items: center; gap: 15px; margin-bottom: 20px; flex-wrap: wrap;
    border-bottom: 1px solid rgba(73, 80, 87, 0.15); padding-bottom: 15px;
}
.ts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.ts-toolbar-right { display: flex; gap: 10px; }
.ts-meta { font-size: 14px; color: #495057; opacity: 0.8; }

.ts-file-info {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 14px 18px;
    margin: -8px 0 18px 0;
    font-size: 14px;
    color: #495057;
    line-height: 1.55;
    border-left: 4px solid #FE942C;
}

.ts-file-info-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #343a40;
    text-transform: uppercase;
    font-weight: 700;
}

.ts-file-info-row {
    margin: 3px 0;
}

.ts-file-info-row strong {
    color: #343a40;
}

/* === КНОПКИ === */
.ts-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 50px; cursor: pointer;
    font-size: 14px; font-weight: 600; text-transform: uppercase;
    transition: all 0.3s ease; text-align: center; border: 1px solid transparent;
}
.ts-btn-primary { background-color: #FE942C; color: #343a40 !important; border-color: #FE942C; }
.ts-btn-primary:hover:not(:disabled) { background-color: #e58528; border-color: #e58528; color: #000000 !important; }
.ts-btn-secondary { background-color: transparent; color: #343a40; border-color: rgba(52, 58, 64, 0.4); }
.ts-btn-secondary:hover:not(:disabled) { background-color: #343a40; color: #fae5cf; }
.ts-btn:disabled { opacity: 0.6; cursor: not-allowed; }
input[type="file"]#ts-file { display: none; }

/* === ПЕРЕКЛЮЧАТЕЛЬ === */
.ts-toggle-wrapper { display: flex; align-items: center; cursor: pointer; user-select: none; }
.ts-toggle-input { display: none; }
.ts-toggle-slider {
    position: relative; width: 46px; height: 24px; background-color: rgba(73, 80, 87, 0.3);
    border-radius: 24px; margin-right: 10px; transition: 0.3s background-color ease;
}
.ts-toggle-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: #fae5cf; border-radius: 50%; transition: 0.3s transform ease; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ts-toggle-input:checked + .ts-toggle-slider { background-color: #FE942C; }
.ts-toggle-input:checked + .ts-toggle-slider:before { transform: translateX(22px); background-color: #ffffff; }
.ts-toggle-text { font-size: 14px; font-weight: 600; color: #495057; text-transform: uppercase; }

/* === КАНВАС И OVERLAYS === */
.ts-canvas-container {
    position: relative; width: 100%; height: 600px; background-color: #1a1a1a; 
    background-image: linear-gradient(45deg, #222 25%, transparent 25%), linear-gradient(-45deg, #222 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #222 75%), linear-gradient(-45deg, transparent 75%, #222 75%);
    background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border: 1px solid rgba(73, 80, 87, 0.2); border-radius: 4px; overflow: hidden; box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.ts-spinner-overlay, .ts-message-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background-color: rgba(26, 26, 26, 0.85); color: #fff; text-align: center;
}

.ts-spinner {
    width: 50px; height: 50px; border: 5px solid rgba(254, 148, 44, 0.3);
    border-radius: 50%; border-top-color: #FE942C; animation: ts-spin 1s ease-in-out infinite; margin-bottom: 15px;
}
@keyframes ts-spin { to { transform: rotate(360deg); } }
.ts-spinner-text { font-size: 16px; font-weight: 600; }
.ts-spinner-text small { display: block; margin-top: 5px; font-size: 13px; font-weight: normal; color: #ccc; max-width: 400px; }

.ts-message-box {
    background: #fae5cf; color: #495057; padding: 30px; border-radius: 8px; max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center;
}
.ts-message-icon { color: #FE942C; margin-bottom: 10px; }
.ts-message-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; }

#ts-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#ts-canvas:active { cursor: grabbing; }
.ts-hint { position: absolute; bottom: 12px; left: 12px; color: #ffffff; font-size: 12px; pointer-events: none; background: rgba(52, 58, 64, 0.7); padding: 6px 12px; border-radius: 4px; }

/* === SPOTLIGHT GALLERY === */
.ts-spotlights-container { margin-top: 15px; }
.ts-spotlights-header { font-size: 14px; font-weight: 600; color: #343a40; margin-bottom: 10px; text-transform: uppercase; }
.ts-spotlight-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.ts-spotlight-card {
    flex: 0 0 auto; width: 104px; border: 2px solid; border-radius: 6px;
    background: #fff; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; overflow: hidden;
}
.ts-spotlight-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.ts-spotlight-img { display: block; width: 100px; height: 100px; background: #eee; }
.ts-spotlight-title { font-size: 11px; text-align: center; padding: 5px 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ts-spotlight-empty { font-size: 14px; color: #2b7a0b; font-weight: 600; }

@media (max-width: 768px) {
    .ts-toolbar { flex-direction: column; align-items: stretch; }
    .ts-toolbar-right { display: flex; flex-direction: column; width: 100%; }
    .ts-canvas-container { height: 400px; }
}