/**
 * Candidate Display Plugin Styles
 */

/* Main container */
.cdp-candidates {
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Swiper container */
.cdp-candidates-swiper {
    padding: 2rem 0;
    position: relative;
}

.swiper-slide {
    height: auto !important;
}

/* Candidate card */
.cdp-candidate {
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0.5rem;
}

.cdp-candidate:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Image container */
.cdp-candidate-image-container {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background-color: #f8f9fa;
    flex: 0 0 auto; /* Prevent image container from stretching */
}

.cdp-candidate-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f6f8fa 0%, #e9ecef 100%);
}

.cdp-candidate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cdp-candidate:hover .cdp-candidate-image img {
    transform: scale(1.05);
}

/* Level pill */
.cdp-level-pill {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #0073aa;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Placeholder for missing images */
.cdp-no-image {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f6f8fa 0%, #e9ecef 100%);
}

.cdp-candidate-initials {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: #495057;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Information section */
.cdp-candidate-info {
    padding: 1.5rem;
    flex: 1 0 auto; /* Allow info section to grow but maintain size */
    display: flex;
    flex-direction: column;
}

.cdp-candidate-number {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    text-align: center;
}

/* Actions section */
.cdp-candidate-actions {
    margin-top: auto; /* Push actions to bottom */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
}

/* View button */
.cdp-view-button {
    width: 100%;
    display: inline-block;
    padding: 0.7rem 1.4rem;
    background-color: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 115, 170, 0.2);
    text-align: center;
}

.cdp-view-button:hover {
    background-color: #005d87;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 5px 10px rgba(0, 115, 170, 0.3);
}

.cdp-view-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    color: #0073aa;
    background-color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.2rem;
}

.swiper-button-next {
    right: 10px;
}

.swiper-button-prev {
    left: 10px;
}

/* Swiper Pagination */
.swiper-pagination-bullet {
    background: #0073aa;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* Empty state and error messages */
.cdp-no-candidates,
.cdp-error {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    color: #6c757d;
    text-align: center;
    font-size: 1.1rem;
}

.cdp-error {
    border-left-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

/* Audio player styling */
.cdp-audio-player {
    margin: 1rem 0;
    width: 100%;
}

.cdp-audio-player audio {
    width: 100%;
    height: 36px;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.cdp-audio-player audio::-webkit-media-controls-panel {
    background-color: #f8f9fa;
    border-radius: 4px;
}

.cdp-audio-player audio::-webkit-media-controls-play-button {
    background-color: #0073aa;
    border-radius: 50%;
}

.cdp-audio-player audio::-webkit-media-controls-play-button:hover {
    background-color: #005d87;
}

.cdp-audio-player audio::-webkit-media-controls-current-time-display,
.cdp-audio-player audio::-webkit-media-controls-time-remaining-display {
    color: #495057;
}

.cdp-audio-player audio::-webkit-media-controls-timeline {
    background-color: #e9ecef;
    border-radius: 2px;
    height: 4px;
}

.cdp-audio-player audio::-webkit-media-controls-volume-slider {
    background-color: #e9ecef;
    border-radius: 2px;
    padding: 0 5px;
}

.cdp-audio-player audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb {
    background: #0073aa;
    border-radius: 50%;
}

/* Audio player overlay */
.cdp-audio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.cdp-candidate-image-container:hover .cdp-audio-overlay {
    opacity: 1;
}

.cdp-audio-player {
    position: relative;
    width: 80px;
    height: 80px;
}

.cdp-play-button {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 115, 170, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cdp-play-button:hover {
    background: rgba(0, 115, 170, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.cdp-play-button:active {
    transform: scale(0.95);
}

.cdp-play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 4px;
}

.cdp-play-button.playing .cdp-play-icon {
    width: 20px;
    height: 20px;
    border: none;
    position: relative;
}

.cdp-play-button.playing .cdp-play-icon::before,
.cdp-play-button.playing .cdp-play-icon::after {
    content: '';
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    background-color: #ffffff;
    border-radius: 3px;
}

.cdp-play-button.playing .cdp-play-icon::before {
    left: 0;
}

/* Small audio player styling */
.cdp-small-audio-player {
    width: 100%;
    margin-bottom: 0.5rem;
    min-height: 36px; /* Add fixed height to prevent shifting */
}

.cdp-small-audio-player audio {
    width: 100%;
    height: 36px;
    border-radius: 18px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    outline: none;
}

/* Custom styling for audio controls */
.cdp-small-audio-player audio::-webkit-media-controls-panel {
    background: #f5f5f5;
    border-radius: 18px;
    padding: 0 5px;
}

.cdp-small-audio-player audio::-webkit-media-controls-play-button {
    background-color: #0073aa;
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.cdp-small-audio-player audio::-webkit-media-controls-timeline {
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 4px;
    margin: 0 5px;
}

.cdp-small-audio-player audio::-webkit-media-controls-volume-slider {
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 4px;
    width: 50px;
}

.cdp-small-audio-player audio::-webkit-media-controls-current-time-display,
.cdp-small-audio-player audio::-webkit-media-controls-time-remaining-display {
    color: #666;
    font-size: 12px;
}

/* Firefox specific styles */
.cdp-small-audio-player audio::-moz-range-track {
    background: #e0e0e0;
    border-radius: 10px;
    height: 4px;
}

.cdp-small-audio-player audio::-moz-range-thumb {
    background: #0073aa;
    border: none;
    border-radius: 50%;
    width: 12px;
    height: 12px;
}

/* Hover effects */
.cdp-small-audio-player audio:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Remove overlay audio player styles */
.cdp-audio-overlay {
    display: none;
}

/* Ensure consistent card heights */
.cdp-candidate {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cdp-candidate-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cdp-candidate-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cdp-small-audio-player {
        min-height: 30px;
    }
    
    .cdp-small-audio-player audio {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .cdp-small-audio-player {
        min-height: 25px;
    }
    
    .cdp-small-audio-player audio {
        height: 25px;
    }
}

/* Update existing styles */
.cdp-view-button {
    margin-top: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .cdp-candidates-swiper {
        padding: 1rem 0;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
    
    .cdp-level-pill {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .cdp-candidate-number {
        font-size: 1.25rem;
    }
    
    .cdp-audio-player {
        margin: 0.75rem 0;
    }
    
    .cdp-audio-player audio {
        height: 32px;
    }
    
    .cdp-small-play-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .cdp-small-play-icon {
        width: 14px;
        height: 14px;
    }
}

.cdp-candidate-display {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cdp-candidate-swiper {
    width: 100%;
    padding: 20px;
}

.cdp-candidate-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.cdp-candidate-card:hover {
    transform: translateY(-5px);
}

.cdp-candidate-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.cdp-candidate-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cdp-audio-player {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 8px;
}

.cdp-audio-player audio {
    width: 100%;
    height: 30px;
}

.cdp-candidate-info {
    padding: 15px;
}

.cdp-candidate-number {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cdp-candidate-level {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
}

/* Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    color: #333;
}

.swiper-pagination-bullet-active {
    background: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cdp-candidate-swiper {
        padding: 10px;
    }
    
    .cdp-audio-player {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 5px;
    }
    
    .cdp-audio-player audio {
        height: 25px;
    }
} 