@charset "UTF-8";

/* Add smooth scrolling to the html element */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial;
    background: var(--bg-color);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    display: flex;
    padding-top: 10px;
    min-width: 800px;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    min-width: 800px;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 10px;
    padding: 0px 20px 20px 20px;
}

.page-header h1 {
    color: var(--font-color);
    margin-bottom: 10px;
    font-size: 28px;
}

.page-header p {
    color: var(--font-color);
    opacity: 0.8;
    font-size: 16px;
    margin: 0;
}

/* Main container */
.groupgen-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 30px;
}

/* Section styling */
.participants-section,
.generation-section {
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    overflow: visible;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    color: var(--font-color);
    margin: 0;
    font-size: 20px;
}

.participant-count {
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

/* Add participant section */
.add-participant {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--font-color);
}

.input-group input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.input-group button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.input-group button:hover {
    background: linear-gradient(135deg, #218838, #1ba085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.bulk-actions button {
    padding: 10px 16px;
    background: var(--bg-color);
    color: var(--font-color);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.bulk-actions button:hover {
    background: var(--border-color);
}

/* Participants list */
.participants-list-container {
    max-height: 350px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--border-color);
    font-weight: bold;
    color: var(--font-color);
    position: relative;
    z-index: 20;
    border-radius: 6px 6px 0 0;
}

.list-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 25;
}

.list-actions button {
    padding: 6px 12px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    position: relative;
    z-index: 30;
}

.list-actions button:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
}

.participants-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: 0 0 6px 6px;
    position: relative;
    z-index: 1;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.participant-item:hover {
    background: var(--content-bg-color);
}

.participant-name {
    color: var(--font-color);
    font-size: 14px;
}

.participant-actions {
    display: flex;
    gap: 5px;
}

.participant-actions button {
    padding: 4px 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.participant-actions button:hover {
    background: #c82333;
}

/* Group configuration */
.group-config {
    margin-bottom: 20px;
}

.config-row {
    margin-bottom: 15px;
}

.config-row label {
    display: block;
    color: var(--font-color);
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: bold;
}

.config-row input[type="number"] {
    width: calc(100% - 4px); /* Account for border width */
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--font-color);
    font-size: 14px;
    box-sizing: border-box; /* Ensure padding and border are included in width */
}

.config-row input[type="number"]:focus {
    border-color: var(--accent-color);
    outline: none;
}

.config-row label input[type="checkbox"] {
    margin-right: 8px;
}

.generation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.primary-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #218838, #1ba085);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

.primary-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generation-actions button:not(.primary-btn) {
    padding: 12px 20px;
    background: var(--bg-color);
    color: var(--font-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.generation-actions button:not(.primary-btn):hover {
    background: var(--border-color);
}

/* Group preview */
.group-preview {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--border-color);
    font-weight: bold;
    color: var(--font-color);
}

.preview-header h4 {
    margin: 0;
    font-size: 16px;
}

.preview-content {
    padding: 15px;
    background: var(--bg-color);
    max-height: 200px;
    overflow-y: auto;
}

.group-item {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--content-bg-color);
    border-radius: 5px;
    border-left: 4px solid var(--accent-color);
}

.group-title {
    font-weight: bold;
    color: var(--font-color);
    margin-bottom: 5px;
}

.group-members {
    color: var(--font-color);
    opacity: 0.8;
    font-size: 14px;
}

/* Export section */
.export-section {
    text-align: center;
}

.export-section button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.export-section button:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
}

/* Groups display section */
.groups-display-section {
    width: 100%;
    max-width: 1200px;
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.groups-header h3 {
    color: var(--font-color);
    margin: 0;
    font-size: 20px;
}

.groups-actions {
    display: flex;
    gap: 10px;
}

.groups-actions button {
    padding: 8px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.groups-actions button:hover {
    background: var(--accent-hover-color);
    transform: translateY(-1px);
}

.groups-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    min-height: 100px; /* Add minimum height for proper centering */
}

/* When groups display contains empty state, center it */
.groups-display:has(.empty-state) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alternative approach for browsers that don't support :has() */
.groups-display .empty-state {
    grid-column: 1 / -1; /* Span all columns */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0px 20px;
    color: var(--font-color);
    opacity: 0.6;
    min-height: 100px;
}

.groups-display .empty-state p {
    margin: 5px 0;
}

.groups-display .empty-state .hint {
    font-size: 12px;
    opacity: 0.8;
}

.group-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.group-card-title {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 16px;
}

.group-card-members {
    color: var(--font-color);
    font-size: 14px;
    line-height: 1.5;
}

.group-card-member {
    padding: 2px 0;
}

/* Statistics section */
.stats-section {
    width: 100%;
    max-width: 1200px;
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.stats-section h3 {
    color: var(--font-color);
    margin-bottom: 20px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--font-color);
    font-size: 14px;
    opacity: 0.8;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--content-bg-color);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--font-color);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--font-color);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--font-color);
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.modal-footer button:not(.primary-btn) {
    background: var(--bg-color);
    color: var(--font-color);
    border: 2px solid var(--border-color);
}

/* Instructions section */
.instructions-section {
    width: 100%;
    max-width: 1200px;
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.instructions-section h3 {
    color: var(--font-color);
    margin-bottom: 20px;
    text-align: center;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.instruction-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.instruction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instruction-number {
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.instruction-content h4 {
    color: var(--font-color);
    margin: 0 0 8px 0;
    font-size: 16px;
}

.instruction-content p {
    color: var(--font-color);
    opacity: 0.8;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--font-color);
    opacity: 0.6;
}

.empty-state p {
    margin: 5px 0;
}

.empty-state .hint {
    font-size: 12px;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .groupgen-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .bulk-actions,
    .list-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .generation-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .groups-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .groups-display {
        grid-template-columns: 1fr;
    }
}

/* Print styles */
@media print {
    .page-header,
    .participants-section,
    .generation-section,
    .stats-section,
    .instructions-section,
    .groups-header .groups-actions {
        display: none;
    }
    
    .groups-display-section {
        box-shadow: none;
        border: none;
    }
    
    .group-card {
        break-inside: avoid;
        margin-bottom: 15px;
    }
}