/* Daily Earnings Monitor - CSS Stylesheet */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header Styles */
header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.2em;
    font-weight: 600;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    text-decoration: none;
    color: #7f8c8d;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

header nav a:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

header nav a.active {
    background: #3498db;
    color: white;
}

header nav a.profile-link {
    background: #6c757d;
    color: white;
}

header nav a.profile-link:hover {
    background: #5a6268;
    color: white;
}

header nav a.logout-link {
    background: #dc3545 !important;
    color: white !important;
    font-weight: 500 !important;
}

header nav a.logout-link:hover {
    background: #c82333 !important;
    color: white !important;
    transform: translateY(-1px);
}

/* Message Styles */
.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group input[type="number"] {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Period Filter Styles */
/* Combined Filter Bar Styles */
.combined-filter-bar {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.filter-section {
    flex: 1;
}

.filter-section h2 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.3em;
    white-space: nowrap;
}

.period-section {
    max-width: 400px;
    flex-shrink: 0;
}

.search-section {
    flex: 1;
    min-width: 0;
}

.filter-form {
    display: flex;
    align-items: end;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-form .form-group {
    margin: 0;
    min-width: 120px;
}

.filter-form .form-group:last-child {
    align-self: flex-end;
    margin-bottom: 0;
}

.form-group.no-label {
    margin-bottom: 0;
    align-self: flex-end;
}

.filter-form .form-group.no-label:last-child {
    margin-bottom: 0;
}

/* Period filter styles now use the standard filter-form layout */


/* Search Controls - Now part of Combined Filter Bar */
.search-controls {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.search-controls .form-group {
    margin: 0;
    min-width: 160px;
    flex: 1;
}

.search-input {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.search-input:focus {
    outline: none;
    border-color: #3498db !important;
}

.filter-select {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db !important;
}

.no-results {
    background: #f8f9fa;
    padding: 40px 20px;
}

.no-results-content p {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Dashboard Actions Styles */
.actions-cell {
    padding: 10px 5px;
    background: #f8f9fa;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.dashboard-btn {
    padding: 6px 12px;
    font-size: 11px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    width: 100px;
    transition: all 0.3s ease;
}

.dashboard-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.delete-form {
    margin: 0;
    display: inline-block;
}

.delete-form button {
    cursor: pointer;
    border: none;
    padding: 6px 12px;
    font-size: 11px;
    width: 100px;
    transition: all 0.3s ease;
}

.delete-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Delete Modal Styles */
.delete-modal-content {
    max-width: 450px;
    border-radius: 8px;
    overflow: hidden;
}

.delete-modal-header {
    background: #dc3545;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body p {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    color: #333;
}

.delete-account-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 0;
}

.delete-account-info strong {
    color: #856404;
    font-size: 1.1em;
    display: block;
    margin-bottom: 10px;
}

.warning-text {
    margin: 0;
    color: #856404;
    font-size: 0.9em;
    line-height: 1.4;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.modal-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.modal-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.modal-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.modal-footer .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

/* Account Modal Styles */
.account-modal-content {
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
}

.account-modal-header {
    background: #28a745;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

/* Edit Account Modal Styles */
.edit-account-modal-content {
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
}

.edit-account-modal-header {
    background: #f39c12;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-account-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

/* Profile Modal Styles */
.profile-modal-content {
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
}

.profile-modal-header {
    background: #6c757d;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.password-requirements {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #6c757d;
}

.password-requirements small {
    color: #6c757d;
    font-style: italic;
}

.account-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.account-form .form-group {
    flex: 1;
    margin-bottom: 15px;
}

.account-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.account-form input,
.account-form select,
.account-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    resize: vertical;
}

/* Special styling for RDP/Bot input field */
.account-form .number-input {
    width: 200px !important;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.account-form input:focus,
.account-form select:focus,
.account-form textarea:focus {
    outline: none;
    border-color: #28a745;
}

.account-form input[type="number"] {
    -moz-appearance: textfield;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

/* Account Form Styles */
.account-form-section,
.accounts-list-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.account-form-section h2,
.accounts-list-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.accounts-table,
.earnings-dashboard {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.accounts-table th,
.earnings-dashboard th {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.accounts-table td,
.earnings-dashboard td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

.accounts-table tr:hover {
    background: #f8f9fa;
}

/* Dashboard Specific Styles */
.dashboard-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.dashboard-section h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.5em;
    flex-shrink: 0;
}

/* Grand Total Display Styles */
.grand-total-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.grand-total-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #7f8c8d;
}

.grand-total-amount {
    font-size: 1.4em;
    font-weight: 700;
    color: #27ae60;
}

.earnings-dashboard {
    font-size: 12px;
}

.account-column {
    min-width: 200px;
    position: sticky;
    left: 0;
    background: #34495e;
    z-index: 9;
}

.type-column {
    min-width: 120px;
    position: sticky;
    left: 200px;
    background: #34495e;
    z-index: 9;
}

.status-column {
    min-width: 80px;
    position: sticky;
    left: 320px;
    background: #34495e;
    z-index: 9;
}

.target-column {
    min-width: 100px;
    position: sticky;
    left: 400px;
    background: #34495e;
    z-index: 9;
}

.actions-column {
    min-width: 150px;
    text-align: center;
    position: sticky;
    left: 500px;
    background: #34495e;
    z-index: 9;
}

.progress-column {
    min-width: 150px;
    text-align: center;
    position: sticky;
    left: 650px;
    background: #34495e;
    z-index: 9;
}

.total-column {
    min-width: 100px;
    text-align: right;
    font-weight: bold;
    position: sticky;
    left: 800px;
    background: #34495e;
    z-index: 9;
}

.day-column {
    min-width: 80px;
    text-align: center;
}

.account-info {
    vertical-align: top;
    padding: 15px;
}

.account-email {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.account-details {
    font-size: 10px;
    color: #7f8c8d;
    line-height: 1.3;
}

.type-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.new-account {
    background: #e3f2fd;
    color: #1976d2;
}

.type-badge.payout-account {
    background: #e8f5e8;
    color: #388e3c;
}

.type-badge.verif-account {
    background: #fff3e0;
    color: #f57c00;
}

.type-badge.banned-account {
    background: #ffebee;
    color: #d32f2f;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-badge.status-running {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.status-done {
    background: #e8f5e8;
    color: #388e3c;
}

.status-badge.status-pending {
    background: #fff8e1;
    color: #f57c00;
}

.account-status {
    text-align: center;
}

.optional-text {
    margin-top: 4px;
    font-size: 9px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 2px solid #6c757d;
    word-break: break-word;
    max-width: 100px;
}

.target-amount {
    font-weight: 600;
    color: #2c3e50;
}

.day-cell {
    text-align: center;
    border-left: 1px solid #ecf0f1;
    border-right: 1px solid #ecf0f1;
}

.day-cell.has-value {
    background: #e8f5e8;
}

.day-cell.zero-value {
    background: #f8f9fa;
}

.earning-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.earning-link:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.monthly-total {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.progress-cell {
    padding: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 10px;
    color: #7f8c8d;
}

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

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    background: #34495e;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.earning-form {
    padding: 25px;
}

.earning-form .form-group input[readonly] {
    background: #f8f9fa;
    color: #7f8c8d;
}

/* Actions Column */
.actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.actions form {
    margin: 0;
}

/* No Accounts Message */
.no-accounts {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.no-accounts p {
    font-size: 1.1em;
    color: #7f8c8d;
}

.no-accounts a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.no-accounts a:hover {
    text-decoration: underline;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 10px;
    }

    .dashboard-section {
        padding: 15px;
    }

    .earnings-dashboard {
        font-size: 11px;
    }

    .day-column {
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .combined-filter-bar,
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .filter-section {
        width: 100%;
    }

    .period-section {
        max-width: none;
    }

    .grand-total-display {
        justify-content: flex-start;
        width: 100%;
    }

    .search-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-controls .form-group {
        min-width: auto;
        width: 100%;
    }

    /* Standard responsive layout for filter form */

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .table-responsive {
        font-size: 10px;
    }

    .accounts-table th,
    .accounts-table td,
    .earnings-dashboard th,
    .earnings-dashboard td {
        padding: 8px;
    }

    .modal-content,
    .delete-modal-content,
    .account-modal-content,
    .edit-account-modal-content,
    .profile-modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .account-column {
        min-width: 150px;
    }

    .type-column {
        min-width: 100px;
        left: 150px;
    }

    .status-column {
        min-width: 70px;
        left: 250px;
    }

    .target-column {
        min-width: 80px;
        left: 320px;
    }

    .actions-column {
        min-width: 120px;
        left: 400px;
    }

    .progress-column {
        min-width: 120px;
        left: 520px;
    }

    .total-column {
        min-width: 80px;
        left: 640px;
    }
}

@media (max-width: 480px) {
    header nav {
        flex-direction: column;
        gap: 10px;
    }

    header nav a {
        text-align: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 5px;
    }

    .combined-filter-bar,
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .grand-total-display {
        justify-content: flex-start;
        width: 100%;
    }

    .grand-total-amount {
        font-size: 1.2em;
    }

    .dashboard-section {
        padding: 10px;
    }

    .earnings-dashboard {
        font-size: 9px;
    }

    .day-column {
        min-width: 60px;
    }

    .accounts-table th,
    .accounts-table td,
    .earnings-dashboard th,
    .earnings-dashboard td {
        padding: 6px 4px;
    }

    .dashboard-btn {
        font-size: 10px;
        padding: 4px 8px;
        width: 80px;
    }

    .delete-form button {
        font-size: 10px;
        padding: 4px 8px;
        width: 80px;
    }

    .action-buttons {
        gap: 3px;
    }

    /* Delete Modal Mobile Styles */
    .delete-modal-header {
        padding: 15px;
    }

    .delete-modal-header h3 {
        font-size: 1.1em;
    }

    .modal-body {
        padding: 20px 15px;
    }

    .modal-body p {
        font-size: 1em;
    }

    .delete-account-info {
        padding: 12px;
    }

    .delete-account-info strong {
        font-size: 1em;
    }

    .warning-text {
        font-size: 0.85em;
    }

    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    /* Account Modal Mobile Styles */
    .account-modal-header {
        padding: 15px;
    }

    .account-modal-header h3 {
        font-size: 1.1em;
    }

    /* Edit Account Modal Mobile Styles */
    .edit-account-modal-header {
        padding: 15px;
    }

    .edit-account-modal-header h3 {
        font-size: 1.1em;
    }

    /* Profile Modal Mobile Styles */
    .profile-modal-header {
        padding: 15px;
    }

    .profile-modal-header h3 {
        font-size: 1.1em;
    }

    .account-form .form-row {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }

    .modal-body {
        padding: 20px 15px;
        max-height: 70vh;
    }

    .account-form .form-group {
        margin-bottom: 12px;
    }

    .account-form label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .account-form input,
    .account-form select {
        padding: 10px;
        font-size: 14px;
    }

    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
}