/* Tool Page Layout */
.tool-page {
    min-height: 100vh;
    padding-top: 80px;
    background: var(--bg-color);
}

.tool-header {
    background: var(--gradient-1);
    padding: 3rem 5%;
    color: white; /* Changed from white */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); /* Added text shadow */
    margin-bottom: 2rem;
}

.tool-intro {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.tool-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.tool-intro i {
    font-size: 2rem;
}

.tool-content {
    padding: 2rem 5%;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
    border: 1px solid #eee; /* Added border */
    padding: 2rem;
}

/* Case Information Styles */
/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-area:hover {
    border-color: var(--gold-color);
    background: #fffbf5;
}

.upload-area i {
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

.upload-area p {
    color: #000000;
}

.upload-area .file-types {
    font-size: 0.9rem;
    color: #999;
    margin-top: 0.5rem;
}

.text-input {
    margin-top: 2rem;
}

.text-input h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

textarea#legalText {
    width: 100%;
    min-height: 250px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #f8f9fa;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

textarea#legalText:focus {
    outline: none;
    border-color: var(--gold-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2); /* Transparent gold shadow */
}

/* Analysis Options */
.analysis-options {
    margin-bottom: 2rem;
}

.analysis-options h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.option-card:hover {
    background: #f0f2f5;
    border-color: var(--gold-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.option-card input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.option-card input[type="checkbox"]:checked {
    background-color: #564727; /* User's requested color */
    border-color: #564727;
}

.option-card input[type="checkbox"]:checked::before {
    content: '\2713'; /* Checkmark */
    display: block;
    color: white;
    font-size: 14px;
    text-align: center;
    line-height: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.option-card i {
    font-size: 1.5rem;
    color: var(--primary-color); /* Keep original primary for icons or adjust */
}

.option-card span {
    font-weight: 500;
    color: var(--text-color);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #564727; /* User's requested color */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(86, 71, 39, 0.3); /* Shadow based on new color */
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(86, 71, 39, 0.4);
    background: #6a5a3a; /* Slightly darker shade for hover */
}

.primary-button i {
    font-size: 1.2rem;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--gold-color); /* Gold color */
    color: var(--text-color); /* Text color for contrast */
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.2); /* Shadow based on gold */
}

.secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    background: #e6c200; /* Slightly darker gold for hover */
}

.secondary-button i {
    font-size: 1rem;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
    border: 1px solid #eee; /* Added border */
    padding: 2rem;
    margin-top: 2rem;
}

.results-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* Enhanced shadow */
}

.result-card h3 {
    color: #564727; /* Use the new primary color for result card titles */
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.structure-tree, .references-list, .key-points, .risk-analysis {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #555;
}

.references-list li, .key-points li {
    margin-bottom: 0.5rem;
    padding-right: 1rem;
    position: relative;
}

.references-list li::before, .key-points li::before {
    content: '\2022'; /* Bullet point */
    color: #564727; /* Use new primary color */
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-right: -1em;
    position: absolute;
    right: 0;
}

.export-section {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header {
        padding: 2rem 5%;
    }

    .tool-intro h1 {
        font-size: 2rem;
    }

    .tool-container {
        padding: 1.5rem;
    }

    .upload-area {
        padding: 2rem;
    }

    .options-grid, .results-grid {
        grid-template-columns: 1fr;
    }

    .export-section {
        flex-direction: column;
        gap: 0.8rem;
    }
}
/* Case Information Styles */
.case-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.case-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.case-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.case-field label {
    font-weight: 600;
    color: var(--text-color);
}

.case-field-value {
    padding: 0.75rem;
    background: white;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.case-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.status-active {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.status-pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-closed {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Legal Text Conversion Tool 2 Styles */
.upload-area {
    background: #ffffff;
    border: 2px dashed #6c7b7f;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    color: #a0a0a0;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: #7c8b8f;
    background: #e7e7e7;
}

.upload-icon {
    font-size: 3rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
    display: block;
}

.upload-text {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    color: #a0a0a0;
}

.upload-or {
    font-size: 1rem;
    margin: 0.5rem 0;
    color: #7f8c8d;
}

.upload-click {
    font-size: 1rem;
    color: #a0a0a0;
    margin: 0;
}

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #c3a483;
    border-radius: 8px;
    border: 1px solid #6c7b7f;
}

.file-icon {
    font-size: 2rem;
    color: #3498db;
}

.file-name {
    flex: 1;
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.remove-file {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.upload-placeholder {
    text-align: center;
}

.processing-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.process-button, .audit-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.process-button {
    background: #9c7f5f;
}

.audit-button {
    background: #9c7f5f;
}

.process-button:hover, .audit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: #7c8b8f;
}

.text-areas-section {
    margin-bottom: 2rem;
}

.text-area-group {
    margin-bottom: 1.5rem;
}

.text-area-label {
    display: block;
    background: #c3a483;
    color: white;
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    text-align: center;
}

.legal-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid #6c7b7f;
    border-radius: 0 0 8px 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: rgb(0, 0, 0);
    resize: vertical;
    border-top: none;
}

.legal-textarea:focus {
    outline: none;
    background: #34495e;
    color: white;
}

.ai-verification-section, .advanced-questions-section, .case-questions-section, .answer-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    background: #c3a483;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    gap: 0.5rem;
}

.ai-icon {
    color: #e74c3c;
}

.question-icon {
    color: #f39c12;
}

.case-icon {
    color: #3498db;
}

.answer-icon {
    color: #27ae60;
}

.generate-button {
    width: 100%;
    padding: 1rem;
    background: #9c7f5f;
    color: white;
    border: none;
    border-radius: 0 0 8px 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-top: 1px solid #5c6b6f;
    margin-top: 20px;
}

.generate-button:hover {
    background: #ad8e6d;
}

.question-textarea, .answer-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid #404040;
    border-radius: 0 0 8px 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: rgb(0, 0, 0);
    resize: vertical;
    border-top: none;
}

.question-textarea:focus, .answer-textarea:focus {
    outline: none;
    background: #34495e;
    color: white;
}

.clear-data-section {
    margin: 2rem 0;
    text-align: center;
}

.clear-data-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #6c7b7f;
}

.clear-data-checkbox input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #6c7b7f;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.clear-data-checkbox input[type="checkbox"]:checked {
    background-color: #6c7b7f;
}

.clear-data-checkbox input[type="checkbox"]:checked::before {
    content: '\2713';
    display: block;
    color: white;
    font-size: 14px;
    text-align: center;
    line-height: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tool-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.api-icon {
    color: #e74c3c;
}

.gradio-icon {
    color: #f39c12;
}

.dropdown-container {
    background: #2c3e50;
    border: 1px solid #6c7b7f;
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.case-dropdown {
    width: 100%;
    padding: 1rem;
    background: #ffffff;
    color: rgb(0, 0, 0);
    border: none;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    border-radius: 0 0 8px 8px;
}

.case-dropdown:focus {
    background: #34495e;
}

.case-dropdown option {
    background: #2c3e50;
    color: white;
    padding: 0.5rem;
}

.settings-icon {
    color: #6c757d;
}

/* Form Elements */
.form-section {
    background: #fdfdfd; /* Lighter background for forms */
    border-radius: 15px; /* More rounded corners */
    padding: 2.5rem; /* Increased padding */
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); /* Softer shadow */
    border: 1px solid #eee; /* Subtle border */
}

.form-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted min width */
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1rem; /* Slightly reduced margin */
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem; /* Increased margin for label */
    font-weight: 600; /* Bolder label */
    color: var(--text-color);
    font-size: 0.95rem; /* Slightly smaller font */
}

.form-control,
.input-group input[type="text"],
.input-group input[type="number"],
.text-input textarea { /* Apply to all relevant inputs */
    width: 100%;
    padding: 0.9rem 1.2rem; /* Increased padding */
    border: 1px solid #ddd;
    border-radius: 8px; /* More rounded input fields */
    font-size: 1rem;
    font-family: inherit;
    background: #f8f9fa;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); /* Inner shadow for depth */
}

.form-control:focus,
.input-group input[type="text"]:focus,
.input-group input[type="number"]:focus,
.text-input textarea:focus {
    outline: none;
    border-color: var(--gold-color); /* Gold border on focus */
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2); /* Transparent gold shadow on focus */
}

textarea.form-control,
.text-input textarea {
    min-height: 180px; /* Slightly increased min-height */
    resize: vertical;
}

.input-grid { /* Specific style for the grid of inputs in sentencing-recommender */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem; /* Space above the grid */
}

.input-group {
    display: flex;
    flex-direction: column; /* Stack label and input */
    gap: 0.5rem; /* Space between label and input */
}

.input-group label {
    margin-bottom: 0; /* Reset margin as gap handles spacing */
}

/* Document Preview */
.document-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.preview-content {
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 5px;
}

/* Timeline */
.case-timeline {
    padding: 2rem;
    background: white;
    border-radius: 10px;
    margin-top: 2rem;
}

.timeline-item {
    position: relative;
    padding-right: 2rem;
    padding-bottom: 2rem;
    border-right: 2px solid #dee2e6;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -9px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-right: 1rem;
}

/* Analysis Results */
.analysis-results {
    margin-top: 2rem;
}

.result-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.result-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .label {
    color: #6c757d;
}

/* Parties Information */
.parties-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.party-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.party-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.party-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.party-details {
    display: grid;
    gap: 0.5rem;
}

.party-field {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #dee2e6;
}

.party-field:last-child {
    border-bottom: none;
}

/* Document Templates */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.template-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
}

.template-card:hover {
    transform: translateY(-5px);
}

.template-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .case-header,
    .form-grid,
    .result-content,
    .parties-info {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
    }

    .preview-header {
        flex-direction: column;
        gap: 1rem;
    }

    .timeline-item {
        padding-right: 1rem;
    }
}
