/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header-content i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.header-content h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Sections */
.section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-header h2 i {
    color: #667eea;
    margin-right: 10px;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: #667eea;
}

.upload-content h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* File List */
.file-list {
    margin: 20px 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-info i {
    font-size: 1.5rem;
    color: #e74c3c;
    margin-right: 15px;
}

.file-details h4 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.file-details p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.file-remove {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.file-remove:hover {
    background: #f8f9fa;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #219a52;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-info:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Section Actions */
.section-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* Analysis Content */
.analysis-content {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: #7f8c8d;
}

.loading-spinner i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.loading-spinner small {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Decision Form */
.decision-form h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.decision-form h3 i {
    color: #f39c12;
    margin-right: 10px;
}

.matters-list {
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
}

.matter-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.matter-item.expanded {
    border-left-color: #27ae60;
    background: #f0f8f0;
}

.matter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.matter-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    flex: 1;
}

.expand-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.expand-btn:hover {
    background: #e3f2fd;
    transform: scale(1.1);
}

.expand-btn.expanded {
    transform: rotate(180deg);
    color: #27ae60;
}

.matter-description {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.decision-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 20px;
    background: white;
    border: 2px solid #ecf0f1;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #667eea;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-option.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

/* Advanced Options */
.advanced-options {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
}

.advanced-options.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.option-group {
    margin-bottom: 15px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.option-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    resize: vertical;
    min-height: 60px;
}

.option-input:focus {
    outline: none;
    border-color: #667eea;
}

.option-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.option-select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 15px;
    background: #f8f9fa;
    border: 1px solid #ecf0f1;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.checkbox-option:hover {
    background: #e3f2fd;
    border-color: #667eea;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
}

.jurisprudence-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.jurisprudence-input input {
    flex: 1;
}

.add-jurisprudence {
    padding: 8px 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.add-jurisprudence:hover {
    background: #219a52;
}

.jurisprudence-list {
    margin-top: 10px;
}

.jurisprudence-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.remove-jurisprudence {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 2px 6px;
}

.instructions-summary {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.instructions-summary h4 {
    color: #2e7d32;
    margin-bottom: 10px;
    font-size: 1rem;
}

.instructions-summary ul {
    margin: 0;
    padding-left: 20px;
    color: #388e3c;
}

.instructions-summary li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Result Content */
.result-content {
    min-height: 300px;
}

.minuta-display {
    margin-top: 20px;
}

.minuta-actions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.minuta-text {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 10px;
    padding: 30px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.8;
    color: #2c3e50;
    white-space: pre-wrap;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease-out;
    max-width: 350px;
}

.toast.success {
    border-left-color: #27ae60;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.warning {
    border-left-color: #f39c12;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 5px;
}

.toast-body {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .section {
        padding: 20px;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .decision-options {
        flex-direction: column;
    }

    .file-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .minuta-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}