/* Group Courses Styles - Kptur */

:root {
    --group-primary: #a855f7;
    --group-primary-hover: #9333ea;
    --group-primary-glow: rgba(168, 85, 247, 0.4);
    --group-secondary: #3b82f6;
    --group-bg: #0f172a;
    --group-card-bg: rgba(30, 41, 59, 0.8);
    --group-glass: rgba(255, 255, 255, 0.05);
    --group-border: rgba(255, 255, 255, 0.1);
    --group-text: #f8fafc;
    --group-text-dim: #94a3b8;
    --group-accent-purple: #7c3aed;
}

/* Section Layout */
.group-courses-container {
    padding: 2rem 0;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.group-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--group-glass);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--group-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--group-text-dim);
    font-weight: 500;
}

.group-select,
.group-input {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid var(--group-border);
    color: var(--group-text);
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color-scheme: dark;
}

.group-select:focus,
.group-input:focus {
    border-color: var(--group-primary) !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;
    background: #0f172a !important;
}

/* Group Cards Grid */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Group Card */
.group-card {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--group-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
}

.group-card:hover {
    transform: translateY(-12px);
    border-color: var(--group-primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 25px rgba(168, 85, 247, 0.3);
}

.group-card-header {
    padding: 1rem 1.5rem;
    position: relative;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.group-badge-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
}

.group-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
}

.badge-open {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-full {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-closed {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.group-card-coach {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
    padding-left: 0;
}

.group-coach-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--group-primary);
    object-fit: cover;
}

.group-coach-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--group-text);
}

.group-coach-rating {
    font-size: 0.8rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.group-card-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 48px;
}

.group-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--group-text);
    text-align: center;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

.group-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.group-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--group-text-dim);
    font-size: 0.9rem;
}

.group-info-item i {
    width: 1.25rem;
    color: var(--group-primary);
}

.group-progress-container {
    margin: 1.5rem 0;
}

.group-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.group-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.group-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--group-secondary), var(--group-primary));
    border-radius: 4px;
    transition: width 1s ease-out;
}

.group-card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--group-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--group-text);
}

.group-price span {
    font-size: 0.9rem;
    color: var(--group-text-dim);
    font-weight: 400;
}

/* Buttons */
.btn-primary-new {
    background: linear-gradient(135deg, var(--group-primary), var(--group-accent-purple));
    color: white;
    border: none;
    padding: 0.8rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 10px var(--group-primary-glow);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary-new:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, var(--group-primary-hover), var(--group-accent-purple));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px var(--group-primary-glow);
}

.btn-primary-new:active {
    transform: translateY(0) scale(0.98);
}

.btn-outline-new {
    background: transparent;
    color: var(--group-text);
    border: 1px solid var(--group-border);
    padding: 0.8rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-new:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--group-text-dim);
}

/* Modal Content New Styles */
.modal-content-new {
    background: #0f172a !important;
    border: 1px solid var(--group-primary) !important;
    border-radius: 2rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(168, 85, 247, 0.2) !important;
    overflow: hidden;
}

.modal-header-new {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(59, 130, 246, 0.2));
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--group-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header-new .close-modal {
    position: relative;
    top: auto;
    right: auto;
}

.modal-header-new h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
}

.modal-body-new {
    padding: 1rem 1.5rem !important;
    max-height: calc(100vh - 180px) !important;
    overflow-y: auto;
}

.close-modal {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--group-text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: rotate(90deg);
}

.close-modal i {
    font-size: 0.9rem;
}

.btn-info-group {
    text-align: left;
    font-family: inherit;
}

.btn-info-group:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

.btn-info-group i {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.btn-info-group span {
    display: block;
    line-height: 1.4;
    text-align: left;
}

#section-group-courses {
    background: #0b0f1a;
    position: relative;
    overflow: hidden;
}

#section-group-courses::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    z-index: 0;
}

#section-group-courses .group-header h1 {
    margin-top: calc(1rem * -0.6) !important;
}

.btn-group-join {
    background: linear-gradient(135deg, var(--group-primary), var(--group-accent-purple));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-group-join:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--group-primary-hover), var(--group-primary));
    box-shadow: 0 8px 20px var(--group-primary-glow);
}

.btn-group-join:disabled {
    background: #334155;
    background-image: none;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

/* Modal and Detail Page */
.group-detail-header {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .group-detail-header {
        grid-template-columns: 1fr 240px;
        gap: 1rem;
    }
}

.group-detail-main h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #fff, var(--group-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.group-detail-meta {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 120px;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--group-text-dim);
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.group-detail-content {
    background: var(--group-card-bg);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--group-border);
}

.group-detail-section {
    margin-bottom: 1.25rem;
}

.group-detail-section h3 {
    margin-bottom: 0.5rem;
    color: var(--group-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.group-detail-section p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.group-detail-section .meta-item {
    margin-left: 0.5rem;
}

.group-sidebar {
    position: sticky;
    top: 2rem;
    margin-left: -20%;
}

.booking-card {
    background: var(--group-card-bg);
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--group-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.booking-card .text-center {
    margin-bottom: 1rem !important;
}

.booking-card .text-center div:first-child {
    font-size: 2rem !important;
    font-weight: 800;
}

.booking-card ul {
    margin-bottom: 1.25rem !important;
    font-size: 0.8rem !important;
}

.booking-card ul li {
    margin-bottom: 0.5rem !important;
}

/* Forms */
.group-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* Rich Text Editor Placeholder */
.rich-editor {
    min-height: 200px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--group-border);
    border-radius: 0.75rem;
    padding: 1rem;
    color: var(--group-text);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-header-new {
        padding: 0.75rem 1rem !important;
    }

    .modal-header-new h2 {
        font-size: 1.1rem !important;
    }

    .modal-body-new {
        padding: 0.75rem 1rem !important;
        max-height: calc(100vh - 140px) !important;
    }

    .group-detail-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .group-detail-main h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .group-detail-meta {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .meta-item {
        min-width: 100px;
    }

    .meta-label {
        font-size: 0.65rem !important;
    }

    .meta-value {
        font-size: 0.85rem !important;
    }

    .group-detail-section {
        margin-bottom: 1rem;
    }

    .group-detail-section h3 {
        font-size: 0.85rem !important;
        margin-bottom: 0.4rem !important;
    }

    .group-detail-section p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }

    .booking-card {
        padding: 1rem !important;
    }

    .booking-card .text-center div:first-child {
        font-size: 1.75rem !important;
    }

    .booking-card ul {
        font-size: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    .group-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .modal-header-new {
        padding: 0.5rem 0.75rem !important;
    }

    .modal-header-new h2 {
        font-size: 1rem !important;
    }

    .modal-body-new {
        padding: 0.5rem 0.75rem !important;
        max-height: calc(100vh - 120px) !important;
    }

    .group-detail-main h1 {
        font-size: 1.25rem !important;
    }

    .group-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .meta-item {
        min-width: 100%;
    }

    .booking-card {
        padding: 0.75rem !important;
    }

    .booking-card .text-center div:first-child {
        font-size: 1.5rem !important;
    }
}

/* Group Chat */
.group-chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--group-border);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 1.5rem;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    position: relative;
    word-break: break-word;
}

.message-received {
    align-self: flex-start;
    background: var(--group-glass);
    border: 1px solid var(--group-border);
    border-bottom-left-radius: 0.25rem;
}

.message-sent {
    align-self: flex-end;
    background: var(--group-primary);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message-info {
    font-size: 0.7rem;
    color: var(--group-text-dim);
    margin-bottom: 0.25rem;
    display: flex;
    gap: 1rem;
}

.message-sent .message-info {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-area {
    padding: 1rem;
    background: var(--group-glass);
    border-top: 1px solid var(--group-border);
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--group-border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--group-text);
    outline: none;
    font-family: inherit;
}

.btn-chat-send {
    background: var(--group-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-chat-send:hover {
    transform: scale(1.1);
    background: #9333ea;
}

/* Danger/Unregister Button */
.btn-danger-outline {
    background: transparent;
    color: #f87171;
    border: 1px solid #f87171;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-danger-outline:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Chat Group Button */
.btn-chat-group {
    background: linear-gradient(135deg, var(--group-secondary), var(--group-primary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-chat-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
}

/* Chat Modal */
.group-chat-modal-content {
    max-width: 600px;
    width: 90%;
    padding: 1rem 1.5rem 1.5rem 1.5rem !important;
}

.group-chat-title {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    padding-top: 0 !important;
    font-size: 1.25rem !important;
}

.group-chat-container {
    margin-top: 0.75rem !important;
}

/* Enrolled Actions */
.enrolled-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Fix: Make entire filter-group clickable to activate input */
.group-form-grid .filter-group {
    cursor: text;
    position: relative;
}

.group-form-grid .filter-group label {
    cursor: text;
    display: block;
    margin-bottom: 0.5rem;
}

/* Make the whole container look interactive */
.group-form-grid .filter-group:hover {
    background: rgba(168, 85, 247, 0.05);
    border-radius: 0.75rem;
    transition: background 0.2s ease;
}

/* Ensure inputs take full width when in filter-group */
.group-form-grid .filter-group .group-input,
.group-form-grid .filter-group .group-select {
    width: 100%;
    cursor: text;
}

/* Fix: Make browser native date/time icons white */
.group-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}