/**
 * Open Applications Card Layout Styles
 * 
 * This file contains styles for the card-based layout of open applications
 * replacing the previous table-based display.
 */

/* Card Container Styles */
.wdmcf-applications-card-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search and Controls Section */
.wdmcf-applications-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    background: white;
    border-radius: 10px;
    padding: 10px 20px;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1);
}

.wdmcf-controls-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.wdmcf-controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.wdmcf-search-box {
    flex: 0 0 300px;
    position: relative;
    display: flex;
    align-items: center;
}

.wdmcf-search-box .dashicons {
    position: absolute;
    left: 15px;
    color: #666;
    font-size: 16px;
    opacity: 0.5;
    z-index: 1;
    width: 10px;
    height: 15px;
}

.wdmcf-search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #e1e4e5;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: white;
}

.wdmcf-search-box input:focus {
    outline: none;
    border-color: var(--ast-global-color-8);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.wdmcf-per-page-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wdmcf-per-page-label {
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.wdmcf-per-page-select {
    padding: 8px 12px;
    border: 1px solid #e1e4e5;
    border-radius: 5px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.wdmcf-per-page-select:focus {
    outline: none;
    border-color: var(--ast-global-color-8);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.wdmcf-download-btn {
    padding: 8px 16px;
    background-color: #171955;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.wdmcf-download-btn:hover {
    background-color: #0f1238;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wdmcf-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wdmcf-download-btn:focus {
    outline: none;
    background-color: #171955;
    color: white;
}

.wdmcf-download-btn .dashicons {
    font-size: 14px;
    opacity: 0.8;
    width: 10px;
    height: 15px;
}

/* Cards Grid - One card per row */
.wdmcf-applications-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* Individual Card */
.wdmcf-application-card {
    background: white;
    border: 1px solid #e1e4e5;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    position: relative;
    overflow: hidden;
}

.wdmcf-application-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ast-global-color-8), #171955);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.wdmcf-application-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--ast-global-color-8);
}

.wdmcf-application-card:hover::before {
    transform: scaleX(1);
}

/* Card Left Column */
.wdmcf-card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 20px;
}

/* Card Right Column */
.wdmcf-card-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
}

/* Project Title */
.wdmcf-card-title {
    font-size: 18px !important;
    font-weight: 600;
    color: #000000 !important;
    margin: 0 !important;
    word-wrap: break-word;
}

/* Working Groups */
.wdmcf-working-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wdmcf-working-group-link {
    display: inline-block;
    color: var(--ast-global-color-8);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.wdmcf-working-group-link:hover {
    color: var(--ast-global-color-8);
    text-decoration: none;
}

.wdmcf-working-group-link:not(:last-child)::after {
    content: ',';
    color: #666;
    font-weight: 400;
    margin-left: 4px;
}

/* Project Venue and Start Date */
.wdmcf-venue-start-container {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.wdmcf-venue-start {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wdmcf-venue-start .dashicons {
    font-size: 14px;
    opacity: 0.5;
    color: #666;
    width: 10px;
    height: 15px;
}

.wdmcf-start-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wdmcf-start-date .dashicons {
    font-size: 14px;
    opacity: 0.5;
    color: #666;
    width: 10px;
    height: 15px;
}

/* Deadline Section */
.wdmcf-deadline-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #d32f2f;
    font-weight: 500;
}

.wdmcf-deadline-container .dashicons {
    font-size: 14px;
    opacity: 0.5;
    color: #d32f2f;
    width: 10px;
    height: 15px;
}

.wdmcf-deadline-label {
    font-weight: 500;
}

.wdmcf-deadline {
    background-color: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 25px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #d32f2f;
    font-weight: 700;
}

/* Learn More Button */
.wdmcf-learn-more-btn {
    padding: 10px 20px;
    background-color: var(--ast-global-color-8);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 140px;
    min-width: 170px;
    align-self: flex-end;
}

.wdmcf-learn-more-btn:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.wdmcf-learn-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wdmcf-learn-more-btn:focus {
    outline: none;
    background-color: var(--ast-global-color-8);
    color: white;
}

/* Total Entries Display */
.wdmcf-total-entries {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e1e4e5;
    font-size: 14px;
    color: #666;
}

.wdmcf-entries-info {
    font-weight: 500;
}

/* Pagination */
.wdmcf-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.wdmcf-pagination button {
    padding: 12px;
    border: 1px solid #d4d4d4;
    background: none;
    color: #666;
    cursor: pointer;
    border-radius: 100%;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdmcf-pagination button:hover:not(:disabled) {
    background-color: var(--ast-global-color-8);
    color: white;
    border-color: var(--ast-global-color-8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wdmcf-pagination button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wdmcf-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wdmcf-pagination .current-page {
    background-color: var(--ast-global-color-8);
    color: white;
    border: 1px solid var(--ast-global-color-8);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* No Results */
.wdmcf-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #e1e4e5;
    width: 100%;
}

.wdmcf-no-results::before {
    content: '☹';
    font-family: Arial, sans-serif;
    display: block;
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
    line-height: 1;
}

/* Loading State */
.wdmcf-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    width: 100%;
}

.wdmcf-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--ast-global-color-8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wdmcf-applications-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .wdmcf-controls-left {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .wdmcf-search-box {
        flex: 1;
        min-width: auto;
    }
    
    .wdmcf-controls-right {
        justify-content: center;
        flex-wrap: nowrap;
    }
    
    .wdmcf-application-card {
        flex-direction: column;
        padding: 15px;
    }
    
    .wdmcf-card-left {
        padding-right: 0;
        padding-bottom: 15px;
    }
    
    .wdmcf-card-right {
        min-width: auto;
    }
    
    .wdmcf-working-groups {
        justify-content: flex-start;
    }
    
    .wdmcf-total-entries {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .wdmcf-pagination {
        justify-content: center;
    }
    
    .wdmcf-download-btn {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .wdmcf-applications-card-container {
        padding: 15px;
    }
    
    .wdmcf-controls-right {
        flex-direction: row;
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .wdmcf-download-btn {
        width: auto;
        flex: 0 0 auto;
    }
    
    .wdmcf-search-box input {
        font-size: 16px;
    }
    
    .wdmcf-card-title {
        font-size: 16px;
    }
    
    .wdmcf-venue-start,
    .wdmcf-start-date,
    .wdmcf-deadline {
        font-size: 13px;
    }
}

/* Download button loading state */
.wdmcf-download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wdmcf-download-btn .dashicons-update-alt {
    animation: spin 1s linear infinite;
}

/* Admin-only controls (when 5 or fewer applications) */
.wdmcf-applications-controls.wdmcf-admin-only {
    justify-content: flex-end;
}

.wdmcf-applications-controls.wdmcf-admin-only .wdmcf-controls-right {
    margin-left: auto;
} 