/* ==========================================
   FILE UPLOAD UI
   ========================================== */

.file-upload-placeholder {
    text-align: center;
    padding: 20px;
    cursor: pointer;
}

.file-upload-placeholder svg {
    color: #667eea;
    margin-bottom: 15px;
    pointer-events: none;
}

.file-upload-placeholder .upload-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 10px 0;
    pointer-events: none;
}

.file-upload-placeholder small {
    color: #999;
    font-size: 13px;
    pointer-events: none;
}

.file-selected-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.file-selected-info .file-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.file-selected-info .file-details {
    flex: 1;
    min-width: 0;
}

.file-selected-info .file-name {
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-selected-info .file-size {
    color: #666;
    font-size: 13px;
}

.remove-file-btn {
    background: #dc3545;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.remove-file-btn svg {
    color: white;
}

.file-upload-area.drag-over {
    border-color: #667eea;
    background-color: #e7f3ff;
    transform: scale(1.02);
}

.file-upload-area.file-selected {
    border-style: solid;
    border-color: #667eea;
}

/* ==========================================
   FEATURES GRID
   ========================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.feature-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.feature-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.1);
}

.feature-option input[type="checkbox"] {
    margin-left: 10px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.feature-option input[type="checkbox"]:checked + .feature-label {
    color: #667eea;
}

.feature-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.feature-label strong {
    font-size: 15px;
    color: #333;
}

.feature-label small {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ==========================================
   PROGRESS BAR
   ========================================== */

.analysis-progress {
    text-align: center;
    padding: 40px 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.analysis-progress h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    margin-top: 15px;
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

/* ==========================================
   BUTTON LOADING STATE
   ========================================== */

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner-inline {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

.animate-slide-in {
    animation: slideIn 0.5s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   RESULTS STYLING
   ========================================== */

.section-title {
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    color: #333;
    font-size: 22px;
}

.section-title:first-child {
    margin-top: 0;
}

.detail-section ul {
    margin: 10px 0;
    padding-right: 25px;
    list-style: none;
}

.detail-section ul li {
    position: relative;
    padding: 8px 0 8px 25px;
    line-height: 1.6;
}

.detail-section ul li:before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    font-size: 18px;
    position: absolute;
    right: -12px;
    top: 4px;
}

.elementor-sticky--active{
    z-index:10;
}

.results-container,
.analysis-progress,
.form-section{
    box-shadow: none !important;
}

.detail-section ol {
    margin: 10px 0;
    padding-right: 25px;
}

.detail-section ol li {
    padding: 8px 0;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* ==========================================
   STRATEGY ITEMS
   ========================================== */

.strategy-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.strategy-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.strategy-item h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 17px;
}

.strategy-item p {
    margin: 0 0 10px 0;
    color: #666;
    line-height: 1.6;
}

.probability-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================
   SCENARIOS
   ========================================== */

.scenarios {
    display: grid;
    gap: 15px;
}

.scenario {
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid;
    line-height: 1.6;
}

.scenario.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.scenario.failure {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.scenario.settlement {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* ==========================================
   WEAKNESS ITEMS
   ========================================== */

.weakness-item {
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-right: 4px solid;
    background: white;
}

.weakness-item strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.weakness-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.weakness-item.severity-high {
    border-color: #dc3545;
    background: #ffe0e0;
}

.weakness-item.severity-medium {
    border-color: #ffc107;
    background: #fff9e6;
}

.weakness-item.severity-low {
    border-color: #28a745;
    background: #e6f9e6;
}

/* ==========================================
   DOCUMENT ITEMS
   ========================================== */

.document-item {
    padding: 15px;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    position: relative;
    padding-right: 80px;
}

.document-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.document-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.priority-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.document-item.priority-critical .priority-badge {
    background: #dc3545;
    color: white;
}

.document-item.priority-important .priority-badge {
    background: #ffc107;
    color: #333;
}

.document-item.priority-optional .priority-badge {
    background: #6c757d;
    color: white;
}

/* ==========================================
   DEADLINE ITEMS
   ========================================== */

.deadline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.deadline-item strong {
    color: #333;
    flex: 1;
}

.deadline-days {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    margin: 0 15px;
}

.deadline-item small {
    color: #999;
    font-size: 12px;
}

/* ==========================================
   CLAUSE ITEMS (Contract Review)
   ========================================== */

.clause-item {
    padding: 15px;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    border-right: 4px solid;
    position: relative;
    padding-top: 45px;
}

.clause-item strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.clause-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.risk-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.clause-item.risk-high {
    border-color: #dc3545;
    background: #ffe0e0;
}

.clause-item.risk-high .risk-badge {
    background: #dc3545;
    color: white;
}

.clause-item.risk-medium {
    border-color: #ffc107;
    background: #fff9e6;
}

.clause-item.risk-medium .risk-badge {
    background: #ffc107;
    color: #333;
}

.clause-item.risk-low {
    border-color: #28a745;
    background: #e6f9e6;
}

.clause-item.risk-low .risk-badge {
    background: #28a745;
    color: white;
}

/* ==========================================
   ERROR BOX
   ========================================== */

.error-box {
    background: #f8d7da !important;
    border-color: #dc3545 !important;
    border-right: 4px solid #dc3545;
}

.error-box h4 {
    color: #721c24 !important;
    margin-bottom: 10px;
}

.error-box p {
    color: #721c24;
    margin: 0;
}

/* ==========================================
   CASE TYPE
   ========================================== */

.case-type {
    padding: 15px;
    background: #e7f3ff;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
}

/* ==========================================
   OVERALL ASSESSMENT
   ========================================== */

.overall-assessment {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ==========================================
   CASES GRID (My Cases)
   ========================================== */

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.case-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.case-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.case-card h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 17px;
}

.case-card small {
    display: block;
    color: #999;
    margin-bottom: 15px;
}

.case-card .btn {
    width: 48%;
    padding: 10px;
    font-size: 14px;
    display: inline-block;
    text-align: center;
}

.btn-small {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

.btn-danger {
    background: #dc3545 !important;
    color: white !important;
}

.btn-danger:hover {
    background: #c82333 !important;
}

/* ==========================================
   MODAL (Case Details)
   ========================================== */

#case-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 99999;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.case-details-content {
    line-height: 1.6;
}

.case-details-content .detail-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.case-details-content .detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.case-details-content h4 {
    color: #667eea;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.case-details-content p {
    margin: 0;
    color: #333;
    line-height: 1.8;
}

.analysis-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-right: 4px solid #667eea;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .file-selected-info {
        flex-direction: column;
        text-align: center;
    }

    .deadline-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .deadline-days {
        margin: 0;
    }

    .document-item {
        padding-right: 15px;
        padding-top: 40px;
    }

    .priority-badge {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .clause-item {
        padding-top: 50px;
    }

    .risk-badge {
        right: 50%;
        transform: translateX(50%);
    }

    .cases-grid {
        grid-template-columns: 1fr;
    }

    .case-card .btn {
        width: 100%;
        margin-bottom: 5px;
        margin-right: 0 !important;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 18px;
    }

    .strategy-item h5 {
        font-size: 15px;
    }

    .file-upload-placeholder {
        padding: 15px;
    }

    .file-upload-placeholder .upload-text {
        font-size: 14px;
    }
}
