:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --background-color: #0f1629;
    --card-bg: #1a2236;
    --text-color: #e9ecef;
    --border-color: #2a3a5a;
    --hover-color: #2c3e50;
    --header-bg: #0a1020;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
}

/* Header Styles */
.main-header {
    background-color: var(--header-bg);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    background-color: rgba(74, 108, 247, 0.2);
    color: var(--primary-color);
}

.main-nav a.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(74, 108, 247, 0.3);
    
}

.main-nav a.active:hover {
    background-color: #3a5bd9; /* Slightly darker shade of primary color */
    opacity: 0.9;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: calc(100vh - var(--header-height));
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 300px;
}

.flash-message {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease;
}

.flash-text {
    flex: 1;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    margin-left: 10px;
}

.flash-close:hover {
    opacity: 1;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.flash-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Auth Forms */
.auth-container {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease-in-out;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: 18px;
    height: 18px;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Admin Dashboard Container */
.admin-container {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px; /* Increase padding for more breathing room */
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
    /* border: 1px solid var(--border-color); */
    animation: fadeIn 0.5s ease-in-out;
    width: 100%;
    max-width: 1200px; /* Increase max-width for a wider container */
    margin: 0 auto; /* Ensure it’s centered */
}

.admin-section {
    margin-top: 20px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* User List Table */
.user-list {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* User List Header */
.user-list-header {
    display: flex;
    background-color: rgba(74, 108, 247, 0.1);
    padding: 15px; /* Slightly increase padding for better spacing */
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

/* User Item Row */
.user-item {
    display: flex;
    padding: 15px; /* Match header padding for consistency */
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-item-col {
    padding: 0 5px;
    display: flex;
    align-items: center;
    text-align: left;
}

/* Fixed Width Columns - Adjusted for better balance */
.col-username {
    width: 20%;
    min-width: 150px; /* Increase min-width for better spacing */
}

.col-email {
    width: 30%;
    min-width: 200px; /* Increase min-width for better spacing */
}

.col-status {
    width: 15%;
    min-width: 120px; /* Slightly increase for better centering */
    justify-content: center;
}

.col-date {
    width: 15%;
    min-width: 120px; /* Slightly increase for better centering */
    justify-content: center;
}

/* Adjust the col-actions to display buttons horizontally */
.col-actions {
    width: 20%;
    min-width: 180px; /* Increase min-width to accommodate both buttons comfortably */
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 10px; /* Ensure consistent spacing between buttons */
}

.action-separator {
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.view-details-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Remove the full width from toggle-status-btn */
/* Button Adjustments */
.toggle-status-btn {
    width: auto;
    padding: 8px 12px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
}

.status-badge.inactive {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

.action-col {
    justify-content: flex-end;
}

.no-users-message {
    padding: 20px;
    text-align: center;
    color: var(--secondary-color);
}

/* Inactive User Message */
.inactive-user-message {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.inactive-user-message i {
    font-size: 1.5rem;
    color: var(--danger-color);
}

.disabled-form {
    opacity: 0.7;
    pointer-events: none;
}

/* FTP Connection Styles */
.ftp-connection-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    /* background-color: #f8f9fa; */
    background-color: rgba(74, 108, 247, 0.1);
    border: 1px solid rgba(74, 108, 247, 0.6);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ftp-buttons {
    display: flex;
    gap: 10px;
}

.connection-status {
    display: flex;
    align-items: center;
}

.indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.indicator.connected {
    background-color: #28a745;
    box-shadow: 0 0 10px #28a745;
    animation: pulse 2s infinite;
}

.indicator.disconnected {
    background-color: #dc3545;
    box-shadow: 0 0 5px #dc3545;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

#connection-text {
    font-weight: 500;
}

/* Original Upload Styles */
.container {
    width: 60%;
    /* max-width: 800px; */
}

.upload-container {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease-in-out;
}

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

h1 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.upload-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    padding: 15px;
    background-color: rgba(74, 108, 247, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(74, 108, 247, 0.3);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

#file-inputs-container {
    margin-bottom: 20px;
}

.file-input-group {
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input-wrapper {
    position: relative;
    width: 100%;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-input-ui:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.file-input-ui i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-name {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--primary-color);
    word-break: break-all;
    text-align: center;
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    /* flex: 1; */
    flex: 0 0 auto;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a5bd9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 108, 247, 0.4);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.btn-secondary.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 108, 247, 0.4);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 10px;
    flex: 0 0 auto;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

#progress-container {
    margin-top: 25px;
}

.progress-label {
    margin-bottom: 10px;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), #6d8dff);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-percentage {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-color);
}

.hidden {
    display: none;
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1100;
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); */
    animation: modalFadeIn 0.3s;
    /* text-align: center; */
    padding: 20px;
}

.modal-icon {
    margin-bottom: 20px;
}

.modal-icon i {
    font-size: 7rem;
    color: var(--primary-color);
}

.modal-content.success .modal-icon i {
    color: var(--success-color);
}

.modal-content.failure .modal-icon i {
    color: var(--danger-color);
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#success-modal .modal-header,
#failure-modal .modal-header {
    display: none;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.close-modal {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
    padding-bottom: 10px;
}

.detail-label {
    width: 35%;
    font-weight: 600;
    color: var(--primary-color);
}

.detail-value {
    width: 65%;
    word-break: break-word;
}

/* Remove the full width from view-details-btn and adjust styling */
.view-details-btn {
    width: auto;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal .btn {
    margin: 0 auto;
    max-width: 200px;
}

.modal.show {
    display: flex;
}

.btn.disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Success and failure modal styling */
#success-modal .modal-content,
#failure-modal .modal-content {
    padding: 40px 30px;
}

#success-modal h2,
#failure-modal h2 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    color: var(--text-color);
}

#success-modal p,
#failure-modal p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

#success-modal .btn,
#failure-modal .btn {
    display: inline-block;
    min-width: 150px;
}

/* File paths container styling */
.file-paths-container {
    margin: 20px 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 10px;
    text-align: left;
}

.file-path-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
}

.file-path-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.file-path-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.file-path-url {
    font-family: monospace;
    word-break: break-all;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 5px;
    border-radius: 4px;
    font-size: 0.9rem;
}


#modal-status.status-active {
    color: var(--success-color);
    font-weight: 600;
}

#modal-status.status-inactive {
    color: var(--danger-color);
    font-weight: 600;
}



/* Adjust the detail-row to support buttons */
.detail-row-with-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
}

/* Ensure the detail-value doesn't take full width when buttons are present */
.detail-value-with-buttons {
    flex: 1;
    margin-right: 15px; /* Add some spacing between the value and buttons */
}

/* Style the modal actions container */
.modal-actions {
    display: flex;
    gap: 10px; /* Space between buttons */
    align-items: center;
}

/* Ensure buttons in the modal are properly sized */
.modal-actions .btn {
    padding: 8px 12px; /* Match the size of buttons in the screenshot */
    font-size: 0.9rem;
}

/* Style the toggle status button in the modal */
#modal-toggle-status-btn.btn-success {
    background-color: var(--success-color);
    color: white;
}

#modal-toggle-status-btn.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

#modal-toggle-status-btn.btn-success:hover {
    background-color: #218838; /* Darker green */
}

#modal-toggle-status-btn.btn-danger:hover {
    background-color: #c82333; /* Darker red */
}

/* Style the view details button (eye icon) */
.modal-actions .view-details-btn {
    padding: 8px; /* Smaller padding for icon-only button */
    display: flex;
    align-items: center;
    justify-content: center;
}