/* ============================================
   Rastreador de Negociações D&D 5e - Estilos
   ============================================ */

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
    color: #2c2416;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    zoom: 0.8;
}

/* ============================================
   Container
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(to bottom, #f4e8d8 0%, #e8dcc8 100%);
    border: 3px solid #8b6f47;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    padding: 30px;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" /></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.03"/></svg>');
    border-radius: 5px;
    pointer-events: none;
}

/* ============================================
   Header
   ============================================ */

.tracker-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #8b6f47;
}

.tracker-header h1 {
    font-size: 2.5em;
    color: #5a3825;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1em;
    color: #6d5743;
    font-style: italic;
}

/* ============================================
   Phase Sections
   ============================================ */

.phase-section {
    margin-bottom: 30px;
}

.phase-section.hidden {
    display: none;
}

.phase-section h2 {
    font-size: 1.8em;
    color: #5a3825;
    margin-bottom: 20px;
    border-bottom: 2px solid #8b6f47;
    padding-bottom: 10px;
}

/* ============================================
   Setup Phase
   ============================================ */

.setup-group {
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid #a88f6f;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.setup-group label {
    display: block;
    font-weight: bold;
    color: #5a3825;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.form-select {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    background: #fff;
    border: 2px solid #8b6f47;
    border-radius: 4px;
    color: #2c2416;
    cursor: pointer;
}

.form-select:hover {
    border-color: #6d5743;
}

.form-textarea {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    background: #fff;
    border: 2px solid #8b6f47;
    border-radius: 4px;
    color: #2c2416;
    resize: vertical;
    min-height: 80px;
}

.modifier-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    font-size: 1em;
    cursor: pointer;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.8);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   Trait Grid
   ============================================ */

.trait-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.trait-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid #a88f6f;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: normal;
}

.trait-checkbox:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #8b6f47;
    transform: translateY(-2px);
}

.trait-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.trait-checkbox input[type="checkbox"]:checked+span {
    font-weight: bold;
    color: #5a3825;
}

.trait-checkbox input[type="checkbox"]:disabled {
    opacity: 0.5;
}

.trait-counter {
    text-align: right;
    font-style: italic;
    color: #6d5743;
    margin-top: 5px;
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary,
.btn-secondary,
.btn-action,
.btn-toggle {
    padding: 12px 24px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #8b6f47 0%, #6d5743 100%);
    color: #f4e8d8;
    border: 2px solid #5a3825;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6d5743 0%, #5a3825 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #9a8876 0%, #7a6856 100%);
    color: #f4e8d8;
    border: 2px solid #6d5743;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7a6856 0%, #6d5743 100%);
}

.btn-action {
    background: linear-gradient(135deg, #5a7a5a 0%, #4a6a4a 100%);
    color: #f4e8d8;
    border: 2px solid #3a5a3a;
    flex: 1;
}

.btn-action:hover {
    background: linear-gradient(135deg, #4a6a4a 0%, #3a5a3a 100%);
    transform: translateY(-2px);
}

.btn-toggle {
    background: linear-gradient(135deg, #7a5a3a 0%, #5a3a2a 100%);
    color: #f4e8d8;
    border: 2px solid #4a2a1a;
    width: 100%;
}

.btn-toggle:hover {
    background: linear-gradient(135deg, #5a3a2a 0%, #4a2a1a 100%);
}

button:active {
    transform: translateY(0);
}

#start-negotiation-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
}

/* ============================================
   Active Phase
   ============================================ */

.negotiation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.negotiation-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.request-display {
    background: rgba(139, 111, 71, 0.1);
    border: 2px solid #8b6f47;
    border-left: 5px solid #8b6f47;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 25px;
    font-style: italic;
}

.request-display strong {
    color: #5a3825;
}

/* ============================================
   Meters
   ============================================ */

.meters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.meter-box {
    background: rgba(255, 255, 255, 0.5);
    border: 3px solid #8b6f47;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.meter-box h3 {
    color: #5a3825;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5em;
}

.meter-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #8b6f47;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.meter-fill {
    height: 100%;
    transition: width 0.5s ease-out;
    border-radius: 13px;
    position: relative;
}

.interest-fill {
    background: linear-gradient(90deg, #5a7a5a 0%, #6a9a6a 50%, #7aba7a 100%);
    box-shadow: 0 0 10px rgba(90, 122, 90, 0.5);
}

.patience-fill {
    background: linear-gradient(90deg, #5a6a8a 0%, #6a8aaa 50%, #7aabca 100%);
    box-shadow: 0 0 10px rgba(90, 106, 138, 0.5);
}

.meter-value {
    text-align: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #5a3825;
    margin-top: 10px;
}

.meter-description {
    text-align: center;
    font-size: 0.9em;
    color: #6d5743;
    font-style: italic;
    margin-top: 5px;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* ============================================
   Outcome Preview
   ============================================ */

.outcome-preview {
    background: rgba(255, 255, 255, 0.5);
    border: 3px solid #8b6f47;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.outcome-preview h3 {
    color: #5a3825;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.1em;
}

.current-outcome-display {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    padding: 10px 12px;
    border-left: 5px solid #8b6f47;
    transition: all 0.3s ease;
}

.current-outcome-display.outcome-positive {
    border-left-color: #5a7a5a;
    background: rgba(90, 122, 90, 0.1);
}

.current-outcome-display.outcome-negative {
    border-left-color: #8a4a4a;
    background: rgba(138, 74, 74, 0.1);
}

.current-outcome-display.outcome-neutral {
    border-left-color: #7a6a5a;
    background: rgba(122, 106, 90, 0.1);
}

.outcome-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #5a3825;
    margin-bottom: 6px;
}

.outcome-desc {
    font-size: 0.95em;
    line-height: 1.4;
    color: #2c2416;
}

.outcome-note {
    text-align: center;
    font-size: 0.9em;
    font-style: italic;
    color: #6d5743;
    margin-top: 10px;
    margin-bottom: 0;
}

/* ============================================
   Actions Panel
   ============================================ */

.actions-panel {
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid #8b6f47;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 25px;
}

.actions-panel h3 {
    color: #5a3825;
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ============================================
   Action Log
   ============================================ */

.action-log-container {
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid #8b6f47;
    border-radius: 5px;
    padding: 20px;
}

.action-log-container h3 {
    color: #5a3825;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-toggle-log {
    background: transparent;
    border: none;
    color: #8b6f47;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.2s;
}

.btn-toggle-log:hover {
    color: #5a3825;
    transform: scale(1.1);
}

.btn-toggle-log.collapsed {
    transform: rotate(-90deg);
}

.btn-toggle-log.collapsed:hover {
    transform: rotate(-90deg) scale(1.1);
}

.action-log {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid #a88f6f;
    border-radius: 4px;
    padding: 15px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.action-log.hidden {
    max-height: 0;
    padding: 0;
    border: none;
    opacity: 0;
    overflow: hidden;
}

.log-entry {
    display: flex;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
    border-left: 4px solid #8b6f47;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.log-number {
    font-weight: bold;
    color: #8b6f47;
    min-width: 30px;
}

.log-content {
    flex: 1;
}

.log-description {
    margin-bottom: 5px;
    color: #2c2416;
}

.log-changes {
    font-size: 0.9em;
    font-weight: bold;
}

.change-positive {
    color: #4a6a4a;
}

.change-negative {
    color: #8a4a4a;
}

/* ============================================
   Outcome Phase
   ============================================ */

.outcome-content {
    background: rgba(255, 255, 255, 0.5);
    border: 3px solid #8b6f47;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.outcome-box h3 {
    color: #6d5743;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.outcome-box h2 {
    color: #5a3825;
    font-size: 2em;
    margin-bottom: 15px;
    border: none;
    padding: 0;
}

.outcome-description {
    font-size: 1.2em;
    line-height: 1.8;
    margin-bottom: 25px;
    color: #4a3422;
    font-style: italic;
}

.outcome-request {
    background: linear-gradient(to right, rgba(139, 111, 71, 0.15), rgba(139, 111, 71, 0.05));
    border-left: 5px solid #8b6f47;
    padding: 18px 20px;
    margin-top: 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.outcome-request strong {
    color: #5a3825;
    font-size: 1.05em;
    display: block;
    margin-bottom: 8px;
}

.outcome-guidance {
    background: linear-gradient(135deg, rgba(244, 232, 216, 0.9) 0%, rgba(232, 220, 200, 0.9) 100%);
    border: 3px solid #8b6f47;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.outcome-guidance h3 {
    color: #6b5442;
    font-size: 1.1em;
    margin-bottom: 15px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.outcome-guidance h2 {
    color: #5a3825;
    font-size: 2.2em;
    margin: 15px 0 25px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(to bottom, #f4e8d8 0%, #e8dcc8 100%);
    border: 3px solid #8b6f47;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease-in-out;
}

.modal-content h3 {
    color: #5a3825;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

#modal-body {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

#modal-body.fade-out {
    opacity: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #5a3825;
    margin-bottom: 8px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-buttons button {
    flex: 1;
}

/* ============================================
   Result Buttons
   ============================================ */

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.btn-result {
    padding: 12px 20px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    font-weight: bold;
    background: linear-gradient(135deg, #5a7a5a 0%, #4a6a4a 100%);
    color: #f4e8d8;
    border: 2px solid #3a5a3a;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-result:hover {
    background: linear-gradient(135deg, #4a6a4a 0%, #3a5a3a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-result:active {
    transform: translateY(0);
}

/* Argument type buttons */
.argument-buttons,
.trait-buttons,
.lie-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.btn-argument-type,
.btn-trait,
.btn-lie {
    padding: 12px 20px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    font-weight: bold;
    background: linear-gradient(135deg, #7a5a3a 0%, #5a3a2a 100%);
    color: #f4e8d8;
    border: 2px solid #4a2a1a;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-argument-type:hover,
.btn-trait:hover,
.btn-lie:hover {
    background: linear-gradient(135deg, #5a3a2a 0%, #4a2a1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-argument-type:active,
.btn-trait:active,
.btn-lie:active {
    transform: translateY(0);
}

.btn-argument-type:disabled,
.btn-trait:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #6a5a4a 0%, #5a4a3a 100%);
}

.btn-argument-type:disabled:hover,
.btn-trait:disabled:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.lie-checkbox-container {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.lie-checkbox-container .checkbox-label {
    font-size: 1em;
    display: flex;
    align-items: center;
    margin: 0;
}

.lie-checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

/* ============================================
   Reference Tables
   ============================================ */

.reference-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #8b6f47;
}

.reference-tables {
    margin-top: 20px;
}

.reference-tables.hidden {
    display: none;
}

.reference-table {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #8b6f47;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.reference-table h3 {
    color: #5a3825;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.reference-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.reference-table table th,
.reference-table table td {
    border: 1px solid #a88f6f;
    padding: 10px;
    text-align: left;
}

.reference-table table th {
    background: #8b6f47;
    color: #f4e8d8;
    font-weight: bold;
}

.reference-table table tr:nth-child(even) {
    background: rgba(139, 111, 71, 0.05);
}

.table-note {
    margin-top: 10px;
    font-size: 0.9em;
    font-style: italic;
    color: #6d5743;
}

/* ============================================
   Footer
   ============================================ */

.tracker-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #8b6f47;
    text-align: center;
    color: #6d5743;
    font-size: 0.9em;
}

.tracker-footer a {
    color: #5a3825;
    text-decoration: none;
    font-weight: bold;
}

.tracker-footer a:hover {
    text-decoration: underline;
}

.tracker-footer p {
    margin: 5px 0;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    .tracker-header h1 {
        font-size: 1.8em;
    }

    .negotiation-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

    .trait-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 20px;
        max-width: 95%;
    }

    .modal-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tracker-header h1 {
        font-size: 1.5em;
    }

    .meter-value {
        font-size: 1.5em;
    }

    .outcome-box h2 {
        font-size: 1.5em;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

.action-log::-webkit-scrollbar {
    width: 10px;
}

.action-log::-webkit-scrollbar-track {
    background: rgba(139, 111, 71, 0.1);
    border-radius: 5px;
}

.action-log::-webkit-scrollbar-thumb {
    background: #8b6f47;
    border-radius: 5px;
}

.action-log::-webkit-scrollbar-thumb:hover {
    background: #6d5743;
}