/**
 * PCS Alumni Achievements Styles
 * Cascading card layout for displaying alumni by achievement category
 */

/* ============================================
   1. Container Styles
   ============================================ */

.pcs-alumni-achievements-container {
    width: 100%;
    margin: 2rem 0;
    box-sizing: border-box;
}

.pcs-alumni-no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

/* ============================================
   2. Category Row Styles
   ============================================ */

.pcs-alumni-row {
    background: #5A6A8B;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    min-height: 380px; /* Slightly taller for larger cards */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pcs-alumni-category-label {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 1rem;
    text-align: center;
    white-space: nowrap;
    min-width: 60px;
    margin-right: 1.5rem;
    flex-shrink: 0;
    z-index: 10;
}

/* ============================================
   3. Cards Container (Scrollable Area)
   ============================================ */

.pcs-alumni-cards-container {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    flex: 1;
    padding: 20px 0;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
    min-height: 360px; /* Taller for 300px cards + name */
    border-radius: 8px;
}

.pcs-alumni-cards-container::-webkit-scrollbar {
    height: 8px;
}

.pcs-alumni-cards-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.pcs-alumni-cards-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.pcs-alumni-cards-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.pcs-alumni-cards-container.dragging {
    cursor: grabbing;
    user-select: none;
}

/* ============================================
   4. Cards Flex Container
   ============================================ */

.pcs-alumni-cards {
    display: flex;
    height: 100%;
    align-items: flex-start;
    padding: 0 20px;
    gap: 0;
    min-width: fit-content;
}

/* ============================================
   5. Individual Alumni Card
   ============================================ */

.pcs-alumni-card {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 350px; /* 300px image + 50px for name */
    margin-right: -40px; /* Less overlap for fewer cards */
    transition: transform 0.3s ease, z-index 0.3s, box-shadow 0.3s ease;
    cursor: pointer;
    z-index: 1;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    -webkit-user-drag: none;
    user-drag: none;
}

.pcs-alumni-card:last-child { 
    margin-right: 0;
}

.pcs-alumni-card:hover {
    transform: scale(1.08) translateY(-10px);
    z-index: 100;
    box-shadow: 
        -15px 15px 25px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(255, 255, 255, 0.1),
        inset 3px 0 6px rgba(0, 0, 0, 0.15);
}

.pcs-alumni-card:hover + .pcs-alumni-card {
    transform: translateX(40px);
}

/* ============================================
   6. Card Image Area
   ============================================ */

.pcs-alumni-card-image {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #e0e0e0;
    box-shadow: 
        -8px 8px 15px rgba(0, 0, 0, 0.3),
        inset 2px 0 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcs-alumni-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top; /* Prioritize face/top of image */
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.pcs-alumni-card:hover .pcs-alumni-card-image img {
    transform: scale(1.02);
}

/* ============================================
   7. Card Name Area
   ============================================ */

.pcs-alumni-card-name {
    width: 100%;
    padding: 10px 10px;
    text-align: left;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: transparent;
    box-sizing: border-box;
}

/* ============================================
   8. Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .pcs-alumni-category-label {
        font-size: 1.5rem;
        min-width: 50px;
        margin-right: 1rem;
    }

    .pcs-alumni-card {
        width: 180px;
        height: 320px;
        margin-right: -35px;
    }

    .pcs-alumni-card-image {
        height: 270px;
    }

    .pcs-alumni-cards-container {
        min-height: 330px;
    }

    .pcs-alumni-row {
        min-height: 350px;
    }
}

/* Mobile landscape */
@media (max-width: 768px) {
    .pcs-alumni-row {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 2rem;
        min-height: auto;
        padding: 1rem 0.5rem;
    }

    .pcs-alumni-category-label {
        writing-mode: horizontal-tb;
        text-orientation: initial;
        transform: none;
        width: 100%;
        text-align: left;
        font-size: 1.4rem;
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .pcs-alumni-cards-container {
        width: 100%;
        min-height: 280px;
    }

    .pcs-alumni-card {
        width: 150px;
        height: 270px;
        margin-right: -30px;
    }

    .pcs-alumni-card-image {
        height: 220px;
    }

    .pcs-alumni-card-name {
        font-size: 0.85rem;
        padding: 6px 2px;
    }

    .pcs-alumni-card:hover {
        transform: scale(1.06) translateY(-8px);
    }

    .pcs-alumni-card:hover + .pcs-alumni-card {
        transform: translateX(30px);
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .pcs-alumni-category-label {
        font-size: 1.2rem;
        padding: 0.5rem 0.8rem;
    }

    .pcs-alumni-card {
        width: 130px;
        height: 240px;
        margin-right: -25px;
    }

    .pcs-alumni-card-image {
        height: 190px;
    }

    .pcs-alumni-card-name {
        font-size: 0.8rem;
    }

    .pcs-alumni-cards-container {
        min-height: 250px;
    }
}

/* ============================================
   9. Touch Device Optimizations
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    .pcs-alumni-card:hover {
        transform: none;
        z-index: 1;
    }

    .pcs-alumni-card:hover + .pcs-alumni-card {
        transform: none;
    }

    .pcs-alumni-card:active {
        transform: scale(1.05);
        z-index: 100;
    }
}

/* ============================================
   10. Accessibility Improvements
   ============================================ */

.pcs-alumni-card:focus,
.pcs-alumni-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    z-index: 100;
}

.pcs-alumni-card:active {
    outline: none !important;
    transform: scale(1.05) translateY(-5px);
    z-index: 100;
}

/* Prevent touch highlight and selection on touch devices */
.pcs-alumni-card,
.pcs-alumni-card *,
.pcs-alumni-cards-container {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .pcs-alumni-card {
        transition: none;
    }

    .pcs-alumni-card:hover {
        transform: none;
    }

    .pcs-alumni-card-image img {
        transition: none;
    }
}

/* ============================================
   11. Modal Styles
   ============================================ */

.pcs-alumni-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pcs-alumni-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.pcs-alumni-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.pcs-alumni-modal-content {
    position: relative;
    display: flex;
    flex-direction: row;
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 1;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pcs-alumni-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcs-alumni-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.pcs-alumni-modal-image {
    flex: 0 0 350px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pcs-alumni-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.pcs-alumni-modal-info {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: 90vh;
}

.pcs-alumni-modal-name {
    margin: 0 0 1rem 0;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    border-bottom: 3px solid #5A6A8B;
    padding-bottom: 0.75rem;
}

.pcs-alumni-modal-meta {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f5f7fa;
    border-radius: 8px;
    border-left: 4px solid #5A6A8B;
}

.pcs-alumni-modal-achievement,
.pcs-alumni-modal-school {
    margin: 0;
    padding: 0.25rem 0;
    font-size: 1rem;
    color: #444;
    line-height: 1.5;
}

.pcs-alumni-modal-achievement strong,
.pcs-alumni-modal-school strong {
    color: #5A6A8B;
}

.pcs-alumni-modal-bio {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
}

.pcs-alumni-modal-bio p {
    margin-bottom: 1rem;
}

.pcs-alumni-modal-bio p:last-child {
    margin-bottom: 0;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .pcs-alumni-modal-content {
        flex-direction: column;
        max-height: 95vh;
    }

    .pcs-alumni-modal-image {
        flex: 0 0 auto;
        max-height: 40vh;
        width: 100%;
    }

    .pcs-alumni-modal-info {
        padding: 1.5rem;
        max-height: 55vh;
    }

    .pcs-alumni-modal-name {
        font-size: 1.5rem;
    }

    .pcs-alumni-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .pcs-alumni-modal-content {
        width: 95%;
        border-radius: 8px;
    }

    .pcs-alumni-modal-info {
        padding: 1rem;
    }

    .pcs-alumni-modal-name {
        font-size: 1.3rem;
    }

    .pcs-alumni-modal-bio {
        font-size: 0.95rem;
    }
}
