/**
 * GridStream Groups Module - Styles
 * @package     mod_gridstream_groups
 * Red/Yellow Cyberpunk Theme
 */

/* Container */
.gridstream-groups-module {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
}

/* Header */
.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(230, 57, 70, 0.05);
    border-radius: 20px 0 20px 0;
    border: 1px solid rgba(230, 57, 70, 0.3);
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.2);
}

.groups-title {
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #e63946;
    text-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
}

.create-group-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #ff8a24 0%, #e63946 100%);
    color: #fff;
    border: none;
    border-radius: 15px 0 15px 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.4);
}

.create-group-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 138, 36, 0.6);
}

/* Filter Tabs */
.groups-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 20px;
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 10px 0 10px 0;
    color: #e63946;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-tab.active {
    background: rgba(255, 138, 36, 0.3);
    box-shadow: 0 0 15px rgba(255, 138, 36, 0.3);
    color: #ff8a24;
}

.filter-tab:hover {
    background: rgba(230, 57, 70, 0.2);
}

/* Loading */
.groups-loading {
    text-align: center;
    padding: 60px 20px;
    color: #ff8a24;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(230, 57, 70, 0.2);
    border-top-color: #e63946;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.groups-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-message {
    font-size: 18px;
    color: #b0b0b0;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Group Card */
.group-card {
    background: rgba(42, 26, 62, 0.8);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 20px 0 20px 0;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.group-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e63946 0%, #ff8a24 100%);
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 30px rgba(230, 57, 70, 0.3);
    border-color: rgba(255, 138, 36, 0.6);
}

.group-card.private {
    border-color: rgba(199, 125, 255, 0.3);
}

.group-card.private::before {
    background: linear-gradient(90deg, #c77dff 0%, #e63946 100%);
}

/* Group Header */
.group-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.group-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px 0 12px 0;
    background: linear-gradient(135deg, #ff8a24 0%, #e63946 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
    text-transform: uppercase;
}

.group-info {
    flex: 1;
    min-width: 0;
}

.group-name {
    font-size: 20px;
    font-weight: bold;
    color: #ff8a24;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.privacy-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px 0 6px 0;
    background: rgba(199, 125, 255, 0.2);
    border: 1px solid rgba(199, 125, 255, 0.4);
    color: #c77dff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.privacy-badge.public {
    background: rgba(255, 138, 36, 0.2);
    border-color: rgba(255, 138, 36, 0.4);
    color: #ff8a24;
}

.group-description {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Group Stats */
.group-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(230, 57, 70, 0.05);
    border-radius: 10px 0 10px 0;
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ff8a24;
    font-size: 14px;
}

.stat-icon {
    font-size: 16px;
}

.stat-value {
    font-weight: bold;
    color: #fff;
}

/* Group Actions */
.group-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px 0 10px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    flex: 1;
}

.btn-join {
    background: linear-gradient(135deg, #ff8a24 0%, #e63946 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.3);
}

.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 138, 36, 0.5);
}

.btn-joined {
    background: rgba(230, 57, 70, 0.2);
    color: #e63946;
    border: 1px solid rgba(230, 57, 70, 0.4);
}

.btn-view {
    background: rgba(199, 125, 255, 0.2);
    color: #c77dff;
    border: 1px solid rgba(199, 125, 255, 0.4);
}

.btn-view:hover {
    background: rgba(199, 125, 255, 0.3);
    transform: translateY(-2px);
}

.btn-leave {
    background: rgba(230, 57, 70, 0.2);
    color: #e63946;
    border: 1px solid rgba(230, 57, 70, 0.4);
}

.btn-leave:hover {
    background: rgba(230, 57, 70, 0.3);
}

/* Role Badge */
.role-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ff8a24 0%, #e63946 100%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 8px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.3);
}

.role-badge.moderator {
    background: linear-gradient(135deg, #60d9fa 0%, #4a9fb8 100%);
}

.role-badge.member {
    background: linear-gradient(135deg, #c77dff 0%, #9d4edd 100%);
}

/* Create Group Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2a1a3e 0%, #1a1625 100%);
    border: 2px solid rgba(230, 57, 70, 0.5);
    border-radius: 25px 0 25px 0;
    padding: 35px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 0 40px rgba(230, 57, 70, 0.4);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(230, 57, 70, 0.3);
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #e63946;
    text-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
}

.close-btn {
    background: none;
    border: none;
    color: #e63946;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 0 8px 0;
}

.close-btn:hover {
    background: rgba(230, 57, 70, 0.2);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #ff8a24;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(230, 57, 70, 0.05);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 12px 0 12px 0;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #ff8a24;
    background: rgba(255, 138, 36, 0.1);
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.char-counter {
    text-align: right;
    color: #ff8a24;
    font-size: 12px;
    margin-top: 5px;
}

.char-counter.warning {
    color: #ff8a24;
}

.char-counter.error {
    color: #e63946;
}

.form-help {
    color: #888;
    font-size: 12px;
    margin-top: 5px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-cancel {
    background: rgba(230, 57, 70, 0.2);
    color: #e63946;
    border: 1px solid rgba(230, 57, 70, 0.4);
}

.btn-cancel:hover {
    background: rgba(230, 57, 70, 0.3);
}

.btn-create {
    background: linear-gradient(135deg, #ff8a24 0%, #e63946 100%);
    color: #fff;
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.4);
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 138, 36, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .groups-grid {
        grid-template-columns: 1fr;
    }

    .groups-header {
        flex-direction: column;
        gap: 15px;
    }

    .create-group-btn {
        width: 100%;
    }

    .groups-filters {
        flex-wrap: wrap;
    }

    .filter-tab {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
}
