/* Estilos do app de territórios */

.ctc-app {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    background: #fafafa;
}

.ctc-user-box {
    margin-bottom: 15px;
}
.ctc-user-box input[type="text"] {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-right: 8px;
}

.ctc-tabs {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ctc-tab-button {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #eee;
    cursor: pointer;
    font-size: 14px;
}
.ctc-tab-button.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.ctc-tab-contents {
    border: 1px solid #ddd;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    min-height: 120px;
}

.ctc-tab-content {
    display: none;
}
.ctc-tab-content.active {
    display: block;
}

.ctc-territorio-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ctc-territorio-item {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.ctc-territorio-thumb img {
    width: 120px;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
}

.ctc-territorio-info h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.ctc-territorio-info p {
    margin: 2px 0;
    font-size: 13px;
}

.ctc-territorio-info button {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}
.ctc-territorio-info button:hover {
    background: #005a87;
}

.ctc-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}
.ctc-modal-open {
    display: block;
}

.ctc-modal-content {
    background-color: #fefefe;
    margin: 30px auto;
    padding: 15px;
    border: 1px solid #888;
    width: 95%;
    max-width: 900px;
    border-radius: 6px;
    position: relative;
}

.ctc-modal-close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
.ctc-modal-close:hover {
    color: #000;
}

.ctc-modal-canvas-wrap {
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}
#ctc-modal-canvas {
    max-width: 100%;
    border: 1px solid #ddd;
    transform-origin: center center;
    transition: transform 0.15s ease-out;
}

/* Controles de zoom dentro do modal */
.ctc-zoom-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.ctc-zoom-controls button {
    border: none;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    cursor: pointer;
}

.ctc-modal-info p {
    margin: 3px 0;
    font-size: 14px;
}

.ctc-modal-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ctc-modal-actions button {
    padding: 7px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
}
#ctc-save-blocks {
    background: #0073aa;
    color: #fff;
}
#ctc-save-blocks:hover {
    background: #005a87;
}
#ctc-finalize-territory {
    background: #46b450;
    color: #fff;
}
#ctc-finalize-territory:hover {
    background: #368a3c;
}

.ctc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ctc-table th,
.ctc-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
}
.ctc-table th {
    background: #f0f0f0;
}

/* Novo território */
.ctc-new-territorio-form {
    max-width: 400px;
}
.ctc-new-territorio-form input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
#ctc-create-territorio-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    background: #28a745;
    color: #fff;
    cursor: pointer;
}
#ctc-create-territorio-btn:hover {
    background: #218838;
}
.ctc-new-territorio-note {
    font-size: 12px;
    color: #555;
}
