/*
 * Projects Feature Styles
 * Styles for project pages (showcase, vacancies, bids, forms, etc.)
 */

/* ===========================================
   SHOWCASE PAGE STYLES
   =========================================== */

.showcase-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.showcase-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 2rem;
}

.showcase-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.visibility-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
}

.project-meta {
    color: #6c757d;
    font-size: 0.875rem;
}

.project-meta i {
    margin-right: 0.25rem;
}

.cta-section {
    background: #f8f9fa;
    padding: 3rem 0;
    margin-top: 3rem;
    text-align: center;
}

.btn-cta {
    background: #667eea;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s ease;
}

.btn-cta:hover {
    background: #5a6fd8;
    color: white;
    text-decoration: none;
}

.academic-year-badge {
    background: #17a2b8;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.skill-badge {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
}

/* ===========================================
   BIDS PAGE STYLES
   =========================================== */

.bid-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease-in-out;
}

.bid-card:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.bid-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 600;
}

.bid-body {
    padding: 1rem;
}

.status-badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.team-members-list {
    max-height: 120px;
    overflow-y: auto;
}

.readiness-score {
    font-weight: 600;
}

.shortlist-actions {
    border-top: 1px solid #dee2e6;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.shortlist-actions .btn {
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
}

.shortlist-actions .btn:last-child {
    margin-right: 0;
}

/* ===========================================
   PROJECT FORM STYLES
   =========================================== */

/* Form error states */
.has-error .note-editor,
.has-error .note-editing-area {
    border: 1px solid #d9534f !important;
}

.has-error .note-toolbar {
    border-bottom: 1px solid #d9534f !important;
}

.field-error {
    margin-top: 5px;
    font-size: 0.9em;
    display: block;
    color: #d9534f !important;
}

.form-group.has-error label,
.form-field.has-error label,
.mb-3.has-error label,
div.has-error label {
    color: #d9534f !important;
}

.has-error {
    background-color: rgba(217, 83, 79, 0.1) !important;
}

/* Skills selector widget */
.skills-selector {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    min-height: calc(2.25rem + 2px);
    background: white;
}

.skills-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.skills-pills:empty {
    margin-bottom: 0;
}

.skill-pill {
    display: inline-flex;
    align-items: center;
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    gap: 0.25rem;
}

.skill-pill-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 1;
}

.skill-pill-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.skills-dropdown {
    width: 100%;
    border: none;
    outline: none;
    background: none;
    font-size: 0.875rem;
}

.skills-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.skill-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
}

.skill-suggestion:hover {
    background-color: #f8f9fa;
}

.skill-suggestion:last-child {
    border-bottom: none;
}

.skills-selector-container {
    position: relative;
}

/* Skills popup modal */
.skills-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
}

.skills-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2001;
}

.skills-popup-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skills-popup-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.skills-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    color: #6c757d;
}

.skills-popup-close:hover {
    color: #343a40;
}

.skills-popup-body {
    padding: 1.5rem;
}

.skills-search-section {
    margin-bottom: 1.5rem;
}

.skills-search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.skill-option {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    cursor: pointer;
    text-align: center;
    font-size: 0.875rem;
    background: white;
}

.skill-option:hover {
    background-color: #f8f9fa;
}

.skill-option.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.skill-option.requested {
    background-color: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.request-skill-section {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.request-skill-form {
    display: flex;
    gap: 0.5rem;
}

.request-skill-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.request-skill-btn {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

.request-skill-btn:hover {
    background: #218838;
}

.request-skill-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.skills-popup-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.browse-skills-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.browse-skills-btn:hover {
    background: #5a6268;
}

/* Field labels with help icons */
.field-label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Form styling improvements */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

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

/* Responsive form enhancements */
@media (max-width: 768px) {
    .browse-skills-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-left: 0.25rem;
    }

    .field-label-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* ===========================================
   PROJECT FORM PAGE ENHANCEMENTS
   =========================================== */

/* Card styling improvements for project forms */
.card {
    border: none;
    border-radius: 0.5rem;
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* Button styling */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

.btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background: #007bff;
    border-color: #007bff;
}

/* Responsive adjustments for project forms */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* ===========================================
   PROJECT CARD GRID STYLES
   =========================================== */

/* Project card enhancements */
.project-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #dee2e6;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-card.owner {
    border: 2px solid #007bff;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    position: relative;
}

.project-card.owner::before {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #007bff;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
    z-index: 1;
}

.project-card.owner[data-owner-type="owned"]::before {
    content: "MY PROJECT";
}

.project-card.owner[data-owner-type="accepted"]::before {
    content: "ACCEPTED";
    background: #28a745;
}

.project-card.owner:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.25);
}

.project-card.owner .card-header {
    background: rgba(0, 123, 255, 0.05) !important;
    border-bottom-color: rgba(0, 123, 255, 0.2) !important;
}

.skills-tags .badge {
    font-size: 0.75rem;
}

.project-indicators {
    min-height: 24px;
}

/* ===========================================
   PROJECT STATUS BADGES
   =========================================== */

.status-badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.status-live {
    background-color: #28a745;
    color: white;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

/* Blinking animation for flags */
.blink {
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0.3;
    }
}

/* ===========================================
   SKILL FILTER COMBO BOX
   =========================================== */

.skill-filter-container {
    position: relative;
}

#skillFilterInput {
    min-height: 38px;
}

.skill-dropdown {
    border-top: none !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    margin-top: -1px;
}

.skill-option {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.skill-option:hover,
.skill-option.highlighted {
    background-color: #f8f9fa;
}

.skill-option:last-child {
    border-bottom: none !important;
}

.skill-option.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* ===========================================
   SELECTED SKILLS BADGES
   =========================================== */

.selected-skills-container .skill-badge {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.selected-skills-container .skill-badge .remove-skill {
    cursor: pointer;
    font-size: 0.875rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.selected-skills-container .skill-badge .remove-skill:hover {
    opacity: 1;
}

/* Dropdown visibility */
.skill-dropdown.show {
    display: block !important;
}

/* ===========================================
   RESPONSIVE GRID ADJUSTMENTS
   =========================================== */

/* Additional row spacing */
.row.g-4.gy-4 > .col {
    margin-bottom: 1rem;
}

/* Card deck responsive adjustments */
@media (max-width: 768px) {
    .row-cols-md-2 {
        --bs-columns: 1;
    }

    .row.g-4.gy-4 > .col {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .row-cols-lg-3 {
        --bs-columns: 4;
    }
}
