:root {
    --shooter-primary: #1e2a3a;
    --shooter-secondary: #2c3e50;
    --shooter-accent: #3498db;
    --newgroup02-primary: #1a1a1a;
    --newgroup02-secondary: #2d2d2d;
    --newgroup02-accent: #e74c3c;
    --newgroup03-primary: #2a1e3a;
    --newgroup03-secondary: #3c2c50;
    --newgroup03-accent: #9b59b6;

    --text-light: #ffffff;
    --text-dark: #333333;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.15);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background: linear-gradient(135deg, #2c3e50, #1a1a1a);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #3498db, #005cd4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 5px 15px;
    width: 300px;
}

.search-container input {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 10px;
    width: 100%;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-container input:focus {
    outline: none;
}

.search-container button {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

/* ปรับตำแหน่งปุ่มกลับใหม่ */
.back-button {
    position: absolute;
    left: 0;
    top: 30%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

/* ปรับ header กลับเป็นแนวนอน */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* ปรับขนาดช่องค้นหา */
.search-container {
    width: 300px;
    margin-top: 0;
}

.search-container input {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 10px;
    width: 100%;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-container input:focus {
    outline: none;
}

.search-container button {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

/* ปรับ header ให้เป็นแนวตั้ง */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ปรับขนาดช่องค้นหาให้เต็มความกว้าง */
.search-container {
    width: 100%;
    max-width: 500px;
    margin-top: 10px;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Group Cards on Home Page */
.group-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* ปรับปรุง CSS สำหรับ group-card */
.group-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 200px; /* กำหนดความสูงขั้นต่ำ */
    width: 100%; /* กำหนดความกว้างให้เต็ม */
}

.group-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* กำหนดให้มี 3 คอลัมน์เท่าๆ กัน */
    gap: 30px;
    margin-bottom: 40px;
}

/* สำหรับหน้าจอขนาดเล็ก */
@media (max-width: 992px) {
    .group-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .group-cards {
        grid-template-columns: 1fr;
    }
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-content {
    padding: 20px;
}

.card-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.card-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.member-preview {
    display: flex;
    gap: 10px;
}

/* .avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    background-image: url('https://via.placeholder.com/40');
    background-size: cover;
    background-position: center;
} */

.avatar-shooter {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* background-color: #3498db; */
    background-image: url('https://img5.pic.in.th/file/secure-sv1/nvf9999999999999999999999999999.png');
    background-size: cover;
    background-position: center;
}

.card-action {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
}

.view-btn {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: linear-gradient(to right, #2980b9, #3498db);
    transform: scale(1.05);
}

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.member-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, background 0.3s ease;
}

.member-card:hover {
    background: var(--card-hover);
    transform: translateY(-3px);
}

.member-number {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3498db;
    background-image: url('https://via.placeholder.com/60');
    background-size: cover;
    background-position: center;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.member-info {
    flex: 1;
}

.member-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-light);
}

.member-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.member-actions {
    margin-left: 10px;
}

.profile-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 250px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.group-info {
    text-align: center;
    margin-bottom: 20px;
}

.group-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #3498db;
    background-image: url('https://via.placeholder.com/100');
    background-size: cover;
    background-position: center;
    margin: 0 auto 15px;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

/* .shooter-logo {
    background-color: #e74c3c;
} */

.group-info h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.group-info p {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.website-btn {
    background: linear-gradient(to right, #3498db, #2980b9);
}

.website-btn:hover {
    background: linear-gradient(to right, #2980b9, #3498db);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Theme Specific Styles */
.shooter-theme {
    background: linear-gradient(135deg, var(--shooter-primary), var(--shooter-secondary));
}

.shooter-theme .profile-btn {
    background: rgba(52, 152, 219, 0.2);
}

.shooter-theme .profile-btn:hover {
    background: rgba(52, 152, 219, 0.3);
}

.newgroup02-theme {
    background: linear-gradient(135deg, var(--newgroup02-primary), var(--newgroup02-secondary));
}

.newgroup02-theme .profile-btn {
    background: rgba(231, 76, 60, 0.2);
}

.newgroup02-theme .profile-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

.newgroup03-theme {
    background: linear-gradient(135deg, var(--newgroup03-primary), var(--newgroup03-secondary));
}

.newgroup03-theme .profile-btn {
    background: rgba(155, 89, 182, 0.2);
}

.newgroup03-theme .profile-btn:hover {
    background: rgba(155, 89, 182, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .search-container {
        width: 100%;
    }

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

    .sidebar {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 30px;
    }

    .back-button {
        position: static;
        transform: none;
        margin-bottom: 15px;
    }
}

/* Profile Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.profile-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #1a1a1a);
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.profile-modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: rgba(255, 255, 255, 1);
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

/* .modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #3498db;
    background-image: url('https://via.placeholder.com/100');
    background-size: cover;
    background-position: center;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.2);
} */

.modal-header h2 {
    font-size: 1.8rem;
    text-align: center;
    margin: 0;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-btn {
    padding: 12px 20px;
    border-radius: 4px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.message-btn {
    background: rgba(52, 152, 219, 0.2);
    color: #ffffff;
}

.message-btn:hover {
    background: rgba(52, 152, 219, 0.4);
}

.modal-btn.profile-btn {
    background: rgba(231, 76, 60, 0.2);
    color: #ffffff;
}

.modal-btn.profile-btn:hover {
    background: rgba(231, 76, 60, 0.4);
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #3498db;
    background-image: url('https://via.placeholder.com/80');
    background-size: cover;
    background-position: center;
    margin-right: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.profile-header h2 {
    font-size: 1.8rem;
    color: var(--text-light);
}

.profile-details {
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    margin-bottom: 10px;
}

.detail-label {
    width: 120px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.detail-value {
    color: var(--text-light);
}

.profile-bio {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
}

.profile-bio h3 {
    margin-bottom: 10px;
    color: var(--text-light);
}

.profile-bio p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.profile-actions {
    display: flex;
    gap: 15px;
}

.profile-actions .action-btn {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dark Mode */
.dark-mode {
    background: linear-gradient(135deg, #121212, #000000);
}

.dark-mode .card-bg {
    background: rgba(30, 30, 30, 0.8);
}

.dark-mode .sidebar {
    background: rgba(20, 20, 20, 0.8);
}

/* Hidden Class */
.hidden {
    display: none;
}

/* Responsive Adjustments for Modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .detail-item {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
}