/* Styles cho container */
body {
    background-color: #f5f5f5;
    min-height: 100vh;
}

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

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Styles cho tool chia nhóm */
.input-section {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.input-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* Styles cho kết quả chia nhóm */
.result-section {
    display: none;
    width: 100%;
    scroll-margin-top: 2rem;
}

.result-section.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.group-result-container{
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Styles cho textarea */
.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    resize: none;
}

.form-control:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* Styles cho kết quả chia nhóm */
.groups-result {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(4, 1fr);
}

.group-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 2s ease;
    opacity: 0;
    animation: fadeIn 2s ease forwards;
}

.group-card:hover {
    transform: translateY(-5px);
}

.group-title {
    color: #4a90e2;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a90e2;
}

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

.group-member {
    padding: 0.5rem 0;
    opacity: 1;
    position: relative;
    border-bottom: none;
}

.group-member.completed {
    border-bottom: 1px solid #e0e0e0;
}

.group-member:last-child {
    border-bottom: none !important;
}

.group-member.typing::after {
    display: none;
}

@keyframes cursor-blink {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Animation cho loading và fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Styles cho modal danh sách đã lưu */
.saved-groups-container {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.saved-groups {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.saved-group-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #e0e0e0;
}

.saved-group-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.saved-group-item.default {
    background: #e3f2fd;
}

.saved-group-item .delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.saved-group-item:hover .delete-btn {
    opacity: 1;
}

.saved-group-item.default .delete-btn {
    display: none;
}

/* Loading animation */
.loading-text {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* Social links */
.social-links {
    text-align: center;
    margin-top: 1rem;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-button {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.social-button:hover {
    opacity: 0.8;
    color: white;
}

.facebook-btn {
    background: #1877f2;
}

.zalo-btn {
    background: #0068ff;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .groups-result {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .input-container, .result-container {
        padding: 1.5rem;
    }
    
    .groups-result {
        grid-template-columns: 1fr;
    }
}

.typing-effect {
    position: relative;
}

.typing-effect::after {
    content: '|';
    position: absolute;
    right: -2px;
    width: 2px;
    height: 100%;
    background-color: #4a90e2;
    animation: cursor-blink 0.8s infinite;
}

@keyframes cursor-blink {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Đảm bảo scroll mượt mà */
html {
    scroll-behavior: smooth;
}

/* Style cho nút control */
#typingControlBtn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#typingControlBtn i {
    font-size: 1.2rem;
}

#typingControlBtn:hover {
    transform: scale(1.1);
}

/* Nút fullscreen */
#fullscreenBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border: 1px solid #e0e0e0;
}

#fullscreenBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#fullscreenBtn i {
    font-size: 1.2rem;
    color: #666;
}

/* Loading Modal */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.show {
    opacity: 1;
}

.modal {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-content {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Fullscreen mode styles */
.fullscreen-mode {
    max-width: 100% !important;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow-y: auto;
}

.fullscreen-mode .input-section {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.fullscreen-mode .result-section {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.fullscreen-mode .group-result-container {
    width: 80%;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Loading Modal trong chế độ fullscreen */
.fullscreen-mode .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

.fullscreen-mode .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

.fullscreen-mode .modal-dialog {
    margin: 2rem auto;
}

.fullscreen-mode .modal-content {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

/* Xóa các style không cần thiết */
.fullscreen-mode .group-title {
    font-size: inherit;
}

.fullscreen-mode .group-member {
    font-size: inherit;
}

/* Responsive adjustments for fullscreen */
@media (max-width: 768px) {
    .fullscreen-mode {
        padding: 1rem;
    }
    
    .fullscreen-mode .group-result-container {
        width: 95%;
        padding: 1rem;
    }
    
    #fullscreenBtn {
        bottom: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
} 