/**
 * Frontend Styles for WPPFU Tutor LMS Groups
 *
 * @package WPPFU_Tutor_LMS_Groups
 * @since 1.0.0
 */

/* Frontend Styles for Tutor LMS Groups */

/* Ensure groups display like Tutor LMS courses */
.tutor-wrap {
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
    padding: 0 15px;
}

.tutor-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tutor-course-list {
    display: grid;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tutor-grid-1 {
    grid-template-columns: 1fr;
}

.tutor-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tutor-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tutor-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.tutor-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tutor-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.tutor-course-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tutor-course-thumbnail {
    position: relative;
    overflow: hidden;
}

.tutor-ratio {
    position: relative;
    width: 100%;
}

.tutor-ratio-16x9 {
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.tutor-card-image-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tutor-card:hover .tutor-card-image-top {
    transform: scale(1.05);
}

.tutor-course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.tutor-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.tutor-badge-success {
    background: #28a745;
    color: #fff;
}

.tutor-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tutor-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #666;
    font-size: 14px;
}

.tutor-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tutor-mb-8 {
    margin-bottom: 8px;
}

.tutor-mb-16 {
    margin-bottom: 16px;
}

.tutor-mt-auto {
    margin-top: auto;
}

.tutor-course-name {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.tutor-course-name a {
    color: #333;
    text-decoration: none;
}

.tutor-course-name a:hover {
    color: #0073aa;
}

.tutor-course-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.tutor-course-excerpt p {
    margin: 0;
}

.tutor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutor-btn-primary {
    background: #0073aa;
    color: #fff;
}

.tutor-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.tutor-btn-outline-primary {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.tutor-btn-outline-primary:hover {
    background: #0073aa;
    color: #fff;
}

.tutor-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.tutor-empty-state-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

.tutor-empty-state-text h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.tutor-empty-state-text p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .tutor-grid-2,
    .tutor-grid-3,
    .tutor-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .tutor-card-body {
        padding: 16px;
    }
    
    .tutor-course-name {
        font-size: 16px;
    }
}

@media (max-width: 1024px) {
    .tutor-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Groups specific styles */
.wppfu-groups-list {
    margin: 0;
    padding: 0;
}

.wppfu-groups-grid {
    display: grid;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wppfu-group-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wppfu-group-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.wppfu-group-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.wppfu-group-title a {
    color: #333;
    text-decoration: none;
}

.wppfu-group-title a:hover {
    color: #0073aa;
}

.wppfu-group-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.wppfu-group-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #666;
    font-size: 14px;
    margin: 0 0 16px 0;
}

.wppfu-member-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wppfu-max-members {
    color: #999;
}

.wppfu-group-full {
    color: #dc3545;
    font-weight: 500;
}

/* Group members list */
.wppfu-group-members {
    margin: 20px 0;
}

.wppfu-members-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wppfu-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wppfu-member-item:last-child {
    border-bottom: none;
}

.wppfu-member-avatar {
    flex-shrink: 0;
}

.wppfu-member-avatar img {
    border-radius: 50%;
}

.wppfu-member-info {
    flex: 1;
}

.wppfu-member-name {
    font-weight: 500;
    margin: 0 0 4px 0;
    color: #333;
}

.wppfu-member-role {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
}

.wppfu-member-joined {
    font-size: 12px;
    color: #999;
}

/* Leader dashboard */
.wppfu-leader-dashboard {
    margin: 20px 0;
}

.wppfu-leader-groups {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wppfu-leader-group {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wppfu-leader-group h3 {
    margin: 0 0 12px 0;
    color: #333;
}

.wppfu-group-stats {
    margin: 0 0 16px 0;
}

.wppfu-stat {
    display: inline-block;
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.wppfu-group-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wppfu-group-actions .button {
    padding: 6px 12px;
    font-size: 13px;
}

/* Join group functionality */
.wppfu-join-group {
    margin: 20px 0;
}

.wppfu-join-group-btn,
.wppfu-leave-group-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wppfu-join-group-btn {
    background: #0073aa;
    color: #fff;
}

.wppfu-join-group-btn:hover {
    background: #005a87;
    color: #fff;
}

.wppfu-leave-group-btn {
    background: #dc3545;
    color: #fff;
}

.wppfu-leave-group-btn:hover {
    background: #c82333;
    color: #fff;
}

/* Loading states */
.wppfu-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wppfu-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wppfu-spin 1s linear infinite;
}

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

/* Notices */
.wppfu-notice {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    background: #f8f9fa;
    color: #333;
}

.wppfu-notice-success {
    border-left-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.wppfu-notice-error {
    border-left-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.wppfu-notice-warning {
    border-left-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

.wppfu-notice-info {
    border-left-color: #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

/* Empty state */
.wppfu-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.wppfu-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.wppfu-empty-state p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Responsive design */
@media screen and (max-width: 768px) {
    .wppfu-groups-grid {
        grid-template-columns: 1fr;
    }
    
    .wppfu-group-card {
        margin-bottom: 16px;
    }
    
    .wppfu-group-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wppfu-member-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wppfu-member-avatar {
        align-self: center;
    }
    
    .wppfu-group-actions {
        flex-direction: column;
    }
    
    .wppfu-group-actions .button {
        width: 100%;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .wppfu-group-card {
        margin: 8px 0;
    }
    
    .wppfu-group-title {
        font-size: 16px;
    }
    
    .wppfu-group-description {
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .wppfu-join-group,
    .wppfu-leave-group-btn,
    .wppfu-group-actions {
        display: none;
    }
    
    .wppfu-group-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .wppfu-group-card {
        border: 2px solid #000;
    }
    
    .wppfu-group-title a {
        text-decoration: underline;
    }
    
    .wppfu-join-group-btn,
    .wppfu-leave-group-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wppfu-group-card {
        transition: none;
    }
    
    .wppfu-group-card:hover {
        transform: none;
    }
    
    @keyframes wppfu-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* Group Detail Page Styles */
.wppfu-group-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wppfu-group-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.wppfu-group-header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.wppfu-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.wppfu-status-active {
    background: #d4edda;
    color: #155724;
}

.wppfu-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.wppfu-group-description {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
    color: #666;
}

.wppfu-group-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wppfu-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wppfu-meta-icon {
    font-size: 20px;
}

.wppfu-meta-value {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* Group Courses Section */
.wppfu-group-courses {
    margin-bottom: 40px;
}

.wppfu-group-courses h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.wppfu-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.wppfu-course-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wppfu-course-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.wppfu-course-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.wppfu-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wppfu-course-card:hover .wppfu-course-thumbnail img {
    transform: scale(1.05);
}

.wppfu-course-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wppfu-placeholder-icon {
    font-size: 48px;
    color: #adb5bd;
}

.wppfu-course-content {
    padding: 20px;
}

.wppfu-course-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.wppfu-course-title a {
    color: #333;
    text-decoration: none;
}

.wppfu-course-title a:hover {
    color: #0073aa;
}

.wppfu-course-instructor {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.wppfu-course-excerpt {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.wppfu-course-actions {
    text-align: center;
}

.wppfu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wppfu-btn-primary {
    background: #0073aa;
    color: #fff;
}

.wppfu-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

/* Group Members Section */
.wppfu-group-members {
    margin-bottom: 40px;
}

.wppfu-group-members h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.wppfu-members-list {
    display: grid;
    gap: 16px;
}

.wppfu-member-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.wppfu-member-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wppfu-member-avatar {
    flex-shrink: 0;
}

.wppfu-member-info {
    flex: 1;
}

.wppfu-member-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wppfu-member-email {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #666;
}

.wppfu-member-role {
    display: inline-block;
    padding: 4px 8px;
    background: #e7f3ff;
    color: #0073aa;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.wppfu-member-joined {
    font-size: 14px;
    color: #999;
    text-align: right;
}

/* Group Leaders Section */
.wppfu-group-leaders {
    margin-bottom: 40px;
}

.wppfu-group-leaders h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.wppfu-leaders-list {
    display: grid;
    gap: 16px;
}

.wppfu-leader-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.wppfu-leader-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wppfu-leader-avatar {
    flex-shrink: 0;
}

.wppfu-leader-info {
    flex: 1;
}

.wppfu-leader-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wppfu-leader-email {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #666;
}

.wppfu-leader-role {
    display: inline-block;
    padding: 4px 8px;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.wppfu-leader-assigned {
    font-size: 14px;
    color: #999;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wppfu-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wppfu-group-header h1 {
        font-size: 24px;
    }
    
    .wppfu-group-meta {
        flex-direction: column;
        gap: 15px;
    }
    
    .wppfu-courses-grid {
        grid-template-columns: 1fr;
    }
    
    .wppfu-member-item,
    .wppfu-leader-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .wppfu-member-joined,
    .wppfu-leader-assigned {
        text-align: left;
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .wppfu-group-detail {
        padding: 15px;
    }
    
    .wppfu-group-header h1 {
        font-size: 20px;
    }
    
    .wppfu-course-content {
        padding: 15px;
    }
    
    .wppfu-course-title {
        font-size: 16px;
    }
}

/* Group Pricing Styles */
.wppfu-group-price {
    margin-bottom: 15px;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.wppfu-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.wppfu-sale-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
    margin-right: 10px;
}

.wppfu-regular-price {
    font-size: 1.2em;
    color: #999;
    text-decoration: line-through;
}

.wppfu-free-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
}

.wppfu-price-info {
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

.wppfu-member-badge {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
}

.wppfu-group-full {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
}

.wppfu-login-required {
    background: #6c757d;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
}

.wppfu-login-required:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

.wppfu-purchase-group-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.wppfu-purchase-group-btn:hover {
    background: #005a87;
}

/* Group Details Modal */
.wppfu-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wppfu-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.wppfu-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 1001;
}

.wppfu-modal-close:hover {
    color: #000;
}

.wppfu-modal-body {
    padding: 20px;
}

/* Group Purchase Shortcode */
.wppfu-group-purchase-shortcode {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wppfu-group-purchase-shortcode .wppfu-group-info h3 {
    margin-top: 0;
    color: #333;
}

.wppfu-group-purchase-shortcode .wppfu-group-price {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.wppfu-group-purchase-shortcode .wppfu-group-actions {
    margin-top: 20px;
}

/* Responsive Design for Pricing */
@media (max-width: 768px) {
    .wppfu-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .wppfu-group-price {
        padding: 10px;
    }
    
    .wppfu-price,
    .wppfu-sale-price,
    .wppfu-free-price {
        font-size: 1.3em;
    }
}
