/* Keyword Research Page Styles */

/* Page Layout */
:root {
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* Main Content Layout */
.main-content {
    padding: 2rem;
    background-color: #f8f9fa;
    min-height: calc(100vh - 60px);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.page-header h1 {
    font-weight: 600;
    color: #2c3e50;
}

/* Auth Message */
.auth-message-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon i {
    font-size: 2rem;
    color: white;
}

/* Badge Styles */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-speed) ease;
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    color: #2c3e50;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Form Elements */
.form-label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.input-group-text {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    color: #6c757d;
}

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background: var(--accent-color);
    border: none;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-primary:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #2c3e50;
    border-bottom-width: 1px;
    padding: 1rem 1.5rem;
}

.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #2c3e50;
}

.table tbody tr {
    transition: background-color var(--transition-speed) ease;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
    cursor: pointer;
}

/* Difficulty Bar */
.difficulty-bar {
    width: 100px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    transition: width var(--transition-speed) ease;
}

/* Loading Spinner */
.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(52, 152, 219, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table th, .table td {
        padding: 0.75rem 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.modal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.modal-value {
    font-size: 1rem;
    color: #212529;
}

.modal-badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #ffffff;
}

.modal-progress {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.modal-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
}

.modal-topic {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-icon {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    color: #6c757d;
}

.modal-metric {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.modal-metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.modal-intent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-intent-description {
    font-size: 0.875rem;
    color: #6c757d;
    flex: 1;
}

/* Table Styles */
.table-hover tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.difficulty-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.trending-score {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 10px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
}

/* Form Styles */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    border-color: #80bdff;
}

.input-group-text {
    background-color: transparent;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

/* Loading Spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
}

/* Keyword Details */
.keyword-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.keyword-stat {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.keyword-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.keyword-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Export Buttons */
.btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    padding: 0.5rem 1rem;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    width: 100px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #2c3e50;
    color: white;
    font-size: 0.875rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-0.5rem);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }

    .table-responsive {
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
}

/* New Task Status Progress Steps Styling */
.progress-steps-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    flex-grow: 1; /* Distribute space evenly among items */
}


.step-circle-wrapper {
    position: relative;
    z-index: 1; /* Ensure circle is above connector */
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef; /* Default light grey for pending */
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d; /* Darker grey for number */
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    position: relative; /* For icon positioning */
    cursor: default; /* Default cursor, can be changed to pointer if steps are clickable */
}

.step-item.active .step-circle,
.step-item.completed .step-circle {
    background-color: #0d6efd; /* Primary blue for active/completed */
    border-color: #0d6efd;
    color: #fff;
}

.step-item.active .step-circle {
     box-shadow: 0 0 10px rgba(13, 110, 253, 0.5); /* Glow for active step */
}

/* Icon and number visibility */
.step-icon, .step-icon-eye {
    display: none;
    font-size: 1.2rem;
}

.step-item.completed .step-icon {
    display: inline-block;
}
.step-item.completed .step-number {
    display: none;
}

/* Specific styling for the 'View Report' eye icon when completed/active */
.step-item#stepViewReport.active .step-icon-eye,
.step-item#stepViewReport.completed .step-icon-eye {
    display: inline-block;
    color: #fff; /* Ensure it's visible on colored background */
}
.step-item#stepViewReport.active .step-number,
.step-item#stepViewReport.completed .step-number {
    display: none;
}

.step-label {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #6c757d; /* Default text color */
    font-weight: 500;
    transition: color 0.3s ease;
    max-width: 80px; /* Ensure labels don't cause overflow */
    line-height: 1.2;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: #0d6efd; /* Primary blue for active/completed label */
    font-weight: 600;
}

.step-connector {
    height: 4px;
    background-color: #e9ecef; /* Default light grey */
    position: absolute;
    top: 18px; /* Align with center of the circle (40px height / 2 - 2px half-height of connector) */
    left: calc(50% + 20px); /* Start after the circle */
    width: calc(100% - 40px); /* Span to the next circle */
    z-index: 0; /* Behind the circle */
    transition: background-color 0.3s ease;
}

.step-item:last-child .step-connector {
    display: none; /* No connector for the last item */
}

.step-item.completed .step-connector {
    background-color: #0d6efd; /* Primary blue for completed connector */
}

/* Action buttons and report note section in modal */
.task-actions-wrapper .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

#reportNoteSectionModal .form-label {
    font-size: 0.9rem;
}

#reportNoteSectionModal textarea {
    font-size: 0.9rem;
}

#viewReportNoteDisplayModal {
    font-size: 0.9rem;
}

#viewReportNoteDisplayModal h6 {
    font-size: 1rem;
}

.task-meta-info small {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Animation for step circle click (example, if made clickable) */
.step-circle:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Ensure modal sections flow correctly */
#taskStatusSection .modal-section {
    border-bottom: none; /* Remove default modal section border if not needed */
    padding-bottom: 0; /* Adjust padding as needed */
}

#taskStatusSection .task-meta-info {
    border-top: 1px solid #eee; /* Add separator for meta info */
    margin-top: 1.5rem;
    padding-top: 1rem;
} 

    /* Modal Styles */
    .modal-content {
        border-radius: 15px;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }

    .modal-body {
        padding: 1.5rem;
    }
    .modal-footer {
        border-top: 1px solid #eee;
        padding: 1.25rem 1.5rem;
    }
    .modal-title {
        font-size: 1.25rem;
        font-weight: 600;
    }
    .modal-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
    .modal-section:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
    .modal-label {
        font-size: 0.875rem;
        font-weight: 500;
        color: #6c757d;
        margin-bottom: 0.5rem;
    }
    .modal-value {
        font-size: 1rem;
        color: #212529;
    }
    .modal-badge {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
    }
    .modal-progress {
        height: 8px;
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    .modal-progress-label {
        display: flex;
        justify-content: space-between;
        font-size: 0.75rem;
        color: #6c757d;
    }
    .modal-topic {
        background: #f8f9fa;
        padding: 1rem;
        border-radius: 8px;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    .modal-icon {
        width: 24px;
        text-align: center;
        margin-right: 0.75rem;
        color: #6c757d;
    }
    .modal-metric {
        display: flex;
        align-items: center;
        padding: 0.75rem;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    .modal-metric-value {
        font-size: 1.25rem;
        font-weight: 600;
        color: #212529;
    }
    .modal-metric-label {
        font-size: 0.875rem;
        color: #6c757d;
        margin-bottom: 0.25rem;
    }
    .modal-intent {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .modal-intent-description {
        font-size: 0.875rem;
        color: #6c757d;
        flex: 1;
    }
    .task-status-badge {
        font-size: 1.1rem;
    }
    .task-status-badge .badge {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    #taskAssignedAt {
        font-size: 0.85rem;
    }
    #completeTaskBtn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    #completeTaskBtn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .task-actions button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    #reportLinkInput {
        font-size: 0.9rem;
    }

    .disabled-row {
        opacity: 0.5; /* Increased opacity slightly for better 'dim' effect over just 'faded' */
        background-color: #e9ecef; /* Slightly darker grey for the row background */
        /* pointer-events: none; */ /* REMOVE this to allow admin buttons to be clickable */
        cursor: not-allowed; /* Still show not-allowed cursor for the row itself */
    }
    .disabled-row td, 
    .disabled-row .text-muted, 
    .disabled-row small {
        color: #6c757d !important; /* Dark grey for text elements, !important to override specifics */
    }
    .disabled-row .badge {
        background-color: #adb5bd !important; /* Grey background for badges */
        color: #f8f9fa !important; /* Lighter text for contrast on grey badge */
        opacity: 0.7;
    }
    .disabled-row .btn {
        pointer-events: auto; /* Ensure all buttons are clickable by default within a disabled row */
        filter: grayscale(80%); /* Make buttons look greyed out */
        opacity: 0.65; /* Further dim the buttons themselves */
    }
    /* Specific override for the admin toggle button to make it appear more active if needed, or leave as is */
    .disabled-row .btn.btn-outline-warning { 
        /* filter: grayscale(0%); */ /* Example: remove greyscale for admin toggle */
        /* opacity: 1; */          /* Example: full opacity for admin toggle */
    }

    .disabled-row .btn.btn-outline-primary[disabled],
    .disabled-row .btn.btn-outline-danger[disabled] {
        /* Styles for buttons that are explicitly disabled via HTML attribute */
        filter: grayscale(90%) opacity(0.4);
        pointer-events: none; /* Ensure truly disabled buttons are not clickable */
    }

    .disabled-row .btn.btn-outline-warning i, /* Ensure toggle icon is visible */
    .disabled-row .btn.btn-outline-primary i,
    .disabled-row .btn.btn-outline-danger i {
        color: #495057 !important; /* Darker icon color for visibility */
    }
    .disabled-row .progress-bar {
        background-color: #adb5bd !important; /* Grey for progress bars */
        opacity: 0.7;
    }
    .disabled-generate-section {
        opacity: 0.7;
        pointer-events: none;
        background-color: #f8f9fa; /* Light grey to indicate disabled */
        padding: 15px;
        border-radius: 5px;
    }
    .disabled-generate-section::before {
        content: "Feature disabled for non-admin users";
        display: block;
        text-align: center;
        color: #6c757d; /* Muted text color */
        font-style: italic;
        margin-bottom: 10px;
    }

/* Disabled Admin-Only Button Styles */
.btn-outline-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.btn-outline-secondary:disabled:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Admin-only button with lock icon */
.btn-outline-secondary:disabled i.fa-lock {
    color: #6c757d;
}

/* Task assignment button states for admin only */
.assign-task-btn.btn-success {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

.assign-task-btn.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.assign-task-btn.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Row color states for task status */
.row-assigned {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.row-in-progress {
    background-color: rgba(255, 193, 7, 0.05) !important;
}

.row-completed {
    background-color: rgba(25, 135, 84, 0.05) !important;
}
