/* Global Styles - ccClub Design System */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f3f6f6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #363636;
    line-height: 1.5;
}

.container {
    background: white;
    border-radius: 4px;
    box-shadow: 0 0.5em 1em -0.125em hsla(0, 0%, 4%, 0.1);
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
}

.container.wide {
    max-width: 1200px;
}

h1 {
    color: #363636;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.125;
}

h2 {
    color: #363636;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.125;
}

.subtitle {
    color: #4a4a4a;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #363636;
    font-weight: 600;
    font-size: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    font-size: 1rem;
    color: #363636;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus,
select:focus {
    outline: none;
    border-color: #377a82;
    box-shadow: 0 0 0 0.125em rgba(55, 122, 130, 0.25);
}

button {
    width: 100%;
    padding: 0.625rem 1rem;
    background-color: #377a82;
    color: white;
    border: 2px solid #377a82;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    line-height: 1.5;
}

button:hover {
    background-color: #2d6369;
    border-color: #2d6369;
}

button:active {
    background-color: #255056;
    border-color: #255056;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.secondary {
    background-color: #949494;
    border-color: #949494;
}

button.secondary:hover {
    background-color: #7a7a7a;
    border-color: #7a7a7a;
}

button.danger {
    background-color: #d24e42;
    border-color: #d24e42;
}

button.danger:hover {
    background-color: #b83e33;
    border-color: #b83e33;
}

button.success {
    background-color: #377a82;
    border-color: #377a82;
}

/* Alert Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: none;
    border-left: 4px solid;
}

.alert.show {
    display: block;
}

.alert.success {
    background-color: #cadfe3;
    border-left-color: #377a82;
    color: #363636;
}

.alert.error {
    background-color: #f8d7da;
    border-left-color: #d24e42;
    color: #721c24;
}

.alert.info {
    background-color: #f3f6f6;
    border-left-color: #949494;
    color: #363636;
}

.alert.warning {
    background-color: #fffef0;
    border-left-color: #fffe69;
    color: #363636;
}

/* Instructions */
.instructions {
    background: #f3f6f6;
    border-left: 4px solid #377a82;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.instructions ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    color: #4a4a4a;
    line-height: 1.5;
}

/* Admin Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.dashboard-actions button {
    width: auto;
    padding: 10px 20px;
}

.search-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-filter input,
.search-filter select {
    flex: 1;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

thead {
    background: #f3f6f6;
}

th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #363636;
    border-bottom: 2px solid #dbdbdb;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #dbdbdb;
    color: #4a4a4a;
}

tr:hover {
    background-color: #f3f6f6;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}

.badge.enabled {
    background: #cadfe3;
    color: #377a82;
}

.badge.disabled {
    background: #f3f6f6;
    color: #949494;
}

.badge.blocked {
    background: #f8d7da;
    color: #d24e42;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons button {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 0.5em 1em -0.125em hsla(0, 0%, 4%, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Larger modal for bulk import */
#bulkImportModal .modal-content {
    max-width: 900px;
    width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    color: #666;
    font-size: 24px;
    width: auto;
    padding: 0;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-footer button {
    flex: 1;
}

/* File Upload */
.file-upload {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.file-upload:hover {
    border-color: #667eea;
}

.file-upload input[type="file"] {
    display: none;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #dbdbdb;
    border-top: 3px solid #377a82;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 1.5rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination Controls */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dbdbdb;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #4a4a4a;
    font-size: 0.875rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    width: auto;
    min-width: 36px;
    padding: 0.5rem 0.75rem;
    background-color: white;
    color: #377a82;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f3f6f6;
    border-color: #377a82;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f3f6f6;
}

.pagination-btn.active {
    background-color: #377a82;
    color: white;
    border-color: #377a82;
}

.pagination-btn.active:hover {
    background-color: #2d6369;
    border-color: #2d6369;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: #949494;
    font-weight: 500;
}

/* Guide Modal (for Discord ID tutorial) */
.guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.guide-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0.5em 1em -0.125em hsla(0, 0%, 4%, 0.1);
}

.guide-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: color 0.3s;
}

.guide-modal-close:hover {
    color: #333;
}

/* Responsive Design */

/* Tablet and below (≤ 1024px) */
@media (max-width: 1024px) {
    .container.wide {
        max-width: 100%;
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .action-buttons button {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 1rem;
    }

    .container.wide {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.125rem;
    }

    /* Dashboard Header */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-header > div:last-child {
        width: 100%;
    }

    .dashboard-header button {
        width: 100%;
    }

    /* Dashboard Actions */
    .dashboard-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dashboard-actions button {
        width: 100%;
    }

    /* Search Filter */
    .search-filter {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-filter button {
        width: 100%;
    }

    /* Table - Horizontal Scroll */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    thead, tbody, tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    th, td {
        padding: 0.5rem 0.25rem;
    }

    /* Make ID column narrower */
    th:first-child, td:first-child {
        width: 40px;
    }

    /* Season column */
    th:nth-child(2), td:nth-child(2) {
        width: 80px;
    }

    /* Name column */
    th:nth-child(3), td:nth-child(3) {
        width: 80px;
    }

    /* Email - truncate with ellipsis */
    td:nth-child(4) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Discord ID - hide on mobile */
    th:nth-child(5), td:nth-child(5) {
        display: none;
    }

    /* Status column */
    th:nth-child(6), td:nth-child(6) {
        width: 60px;
    }

    /* Action buttons */
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    .action-buttons button {
        width: 100%;
        font-size: 0.625rem;
        padding: 4px 6px;
    }

    /* Badge */
    .badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 1rem;
        max-height: 90vh;
    }

    .modal-header {
        margin-bottom: 1rem;
    }

    .modal-header h2 {
        font-size: 1.125rem;
    }

    .modal-close {
        font-size: 20px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer button {
        width: 100%;
    }

    /* Form Groups in Modal */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    .form-group small {
        font-size: 0.75rem;
    }

    /* Guide Modal */
    .guide-modal {
        padding: 1rem;
    }

    .guide-modal-content {
        padding: 1rem;
    }

    .guide-modal-close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }

    /* Pagination */
    .pagination-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pagination-info {
        font-size: 0.75rem;
    }

    .pagination-buttons {
        width: 100%;
        justify-content: center;
    }

    .pagination-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        min-width: 32px;
    }
}

/* Small Mobile (≤ 480px) */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 0.75rem;
        border-radius: 0;
    }

    .container.wide {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    /* Buttons */
    button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Table - even more compact */
    table {
        font-size: 0.625rem;
    }

    th, td {
        padding: 0.375rem 0.125rem;
    }

    /* Hide email column on very small screens */
    th:nth-child(4), td:nth-child(4) {
        display: none;
    }

    .action-buttons button {
        font-size: 0.5rem;
        padding: 3px 5px;
    }

    /* Modal */
    .modal-content {
        width: 100%;
        padding: 0.75rem;
        border-radius: 0;
    }

    /* File Upload */
    .file-upload {
        padding: 15px;
        font-size: 0.875rem;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
    }

    .dashboard-header {
        margin-bottom: 1rem;
    }
}
