/* Shared UI for all tools — extends design-tool.css patterns */

/* Page layout */
.tool-page h1,
.tool-page .tool-intro {
    text-align: center;
}

.wrapper.tool-page {
    overflow-x: visible;
}

.tool-intro {
    margin: 0 0 12px;
    color: #555;
    text-align: center;
}

.tool-hint {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 12px;
    text-align: center;
}

/* Panels — aliases of design-tool-panel */
.tool-panel,
.design-tool-panel {
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.tool-panel + .tool-panel,
.tool-panel + .tool-actions + .tool-panel {
    margin-top: 16px;
}

.tool-panel--output {
    margin-top: 16px;
}

.tool-panel-title,
.design-tool-panel-title {
    font-weight: 600;
    color: var(--color-primary, #663399);
    margin-bottom: 12px;
    text-align: center;
}

.tool-section-title,
.design-tool-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary, #663399);
    margin: 0 0 10px;
    text-align: center;
}

/* Privacy / callout notices */
.tool-privacy-notice,
.pdf-tool .pdf-privacy-notice,
.converter-privacy-notice {
    background: #e8f4fd;
    border-left: 4px solid var(--color-secondary, #00B4D8);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.tool-callout {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--color-primary, #663399);
    background: rgba(102, 51, 153, 0.08);
    border-radius: 0 4px 4px 0;
    text-align: left;
}

.tool-callout p {
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

/* Forms */
.tool-form-group,
.design-tool-form-group {
    margin-bottom: 12px;
}

.tool-form-group:last-child {
    margin-bottom: 0;
}

.tool-form-label,
.design-tool-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.tool-form-control,
.design-tool-form-control {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 0;
    box-sizing: border-box;
}

.tool-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.tool-form-row input,
.tool-form-row select {
    flex: 1;
    min-width: 140px;
}

.tool-form-row--range label {
    flex: 0 0 100%;
}

.tool-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tool-checkbox-group label {
    margin: 0;
    font-weight: normal;
}

/* Actions */
.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
    justify-content: center;
}

.tool-actions .button,
.tool-actions .button-green {
    margin: 0;
}

.tool-page .button-green {
    margin: 0;
}

/* Results */
.tool-result {
    margin-top: 16px;
}

.tool-result h3 {
    font-size: 1.1rem;
    color: var(--color-primary, #663399);
    margin: 0 0 10px;
    text-align: center;
}

.tool-output-box {
    padding: 12px;
    background: #fff;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 48px;
}

.tool-converter-result {
    padding: 12px 16px;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    margin-top: 16px;
    min-height: 40px;
    line-height: 1.6;
}

.tool-stats {
    margin-top: 16px;
    font-size: 1rem;
}

.tool-stats p {
    margin: 6px 0;
    font-weight: normal;
}

.tool-password-output {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

/* Drop zones */
.tool-drop-area,
#dropArea.tool-drop-area,
#drop-area.tool-drop-area,
.tool-page #dropArea,
.tool-page #drop-area {
    border: 2px dashed var(--gray-light, #ccc);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    margin: 16px 0;
    transition: background 0.2s, border-color 0.2s;
}

.tool-drop-area.dragover,
.tool-page #dropArea.dragover,
.tool-page #drop-area.dragover {
    border-color: var(--color-secondary, #00B4D8);
    background: #f0f8ff;
}

.tool-drop-area p,
.tool-page #drop-area p {
    margin: 0;
    font-size: 16px;
    color: #777;
}

.tool-file-input-hidden {
    display: none !important;
}

.tool-gallery-panel {
    padding: 16px;
    margin-top: 16px;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

.tool-gallery-panel h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary, #663399);
    margin: 0 0 12px;
    text-align: center;
}

.tool-image-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
}

.tool-image-controls .tool-form-row {
    justify-content: center;
}

.tool-resolution-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-resolution-row input[type="number"] {
    width: 120px;
}

.tool-resolution-row .separator {
    font-size: 1.25rem;
    font-weight: bold;
}

.tool-image-result {
    margin-top: 16px;
}

.tool-image-result img {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid var(--color-primary, #663399);
}

/* Generators */
.tool-lottery-ball {
    display: inline-block;
    width: 50px;
    height: 50px;
    margin: 10px;
    line-height: 50px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid var(--color-primary, #663399);
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary, #663399);
    text-align: center;
}

.tool-qrcode-result {
    margin-top: 16px;
    text-align: center;
    padding: 16px;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

/* Dice roller */
.tool-dice-result {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tool-dice {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background-color: var(--color-primary, #663399);
    text-align: center;
}

.tool-dice.triangle {
    width: 72px;
    height: 62px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 0;
    align-items: flex-end;
    padding-bottom: 10px;
    box-sizing: border-box;
}

.tool-dice.square {
    width: 60px;
    height: 60px;
    border-radius: 10px;
}

.tool-dice.other {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* Cronômetro */
.tool-cronometro-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary, #663399);
    text-align: center;
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.tool-volta-lista {
    margin-top: 16px;
    font-size: 1rem;
}

.tool-volta-item {
    margin: 5px 0;
    font-weight: 600;
    padding: 6px 10px;
    background: rgba(102, 51, 153, 0.06);
    border-radius: 4px;
}

/* Training tools */
.tool-training-bg {
    background-image: url('/public/img/bg-tools.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.tool-digitacao-text {
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 12px;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.tool-digitacao-text .inactive { color: #999; }
.tool-digitacao-text .default { color: #333; }
.tool-digitacao-text .correct { color: #2e7d32; }
.tool-digitacao-text .incorrect { color: #c62828; }

.tool-digitacao-input {
    width: 100%;
    font-size: 1.2em;
    padding: 10px;
    box-sizing: border-box;
}

.tool-digitacao-stats {
    font-size: 1.1rem;
    margin-top: 12px;
}

.tool-digitacao-stats > div {
    margin: 6px 0;
}

/* Compare table */
.tool-compare-table {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
}

.tool-compare-table th,
.tool-compare-table td {
    padding: 8px 10px;
    text-align: left;
    border: 1px solid var(--gray-light, #ccc);
}

.tool-compare-table th {
    background-color: rgba(102, 51, 153, 0.08);
    color: var(--color-primary, #663399);
    font-weight: 600;
}

.tool-compare-table td {
    background-color: rgba(255, 255, 255, 0.7);
}

.tool-compare-table .diferente {
    background-color: #ffcccb;
}

.tool-removed-lines {
    margin-top: 12px;
    font-size: 0.95rem;
    color: #c0392b;
}

.tool-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 12px 0;
}

.tool-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}

/* Utility */
.is-hidden {
    display: none !important;
}

.tool-page .input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 1rem;
}

.tool-page .button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    justify-content: center;
}

.tool-page .align-right {
    margin-left: auto;
}

/* PDF tools — center title when combined with tool-page */
.wrapper.pdf-tool.tool-page h1,
.wrapper.pdf-tool.tool-page .tool-hint {
    text-align: center;
}

/* Compression slider */
.tool-compression-info {
    font-size: 0.95rem;
    color: #555;
    margin: 8px 0 12px;
    line-height: 1.5;
}
