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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

header h1 {
    color: #23282d;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #2271b1;
    color: white;
}

.btn-primary:hover {
    background-color: #135e96;
}

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

.btn-secondary:hover {
    background-color: #50575e;
}

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

.btn-danger:hover {
    background-color: #b32d2e;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled,
.btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.check-updates-btn {
    transition: opacity 0.2s ease;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #00a32a;
    color: white;
}

.alert-error {
    background-color: #d63638;
    color: white;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    margin-right: 10px;
}

.view-btn {
    padding: 6px 10px;
    min-width: 36px;
}

.view-btn:hover {
    background-color: #f0f0f0;
}

.view-btn.active {
    background-color: #2271b1;
    color: white;
}

.view-btn.active:hover {
    background-color: #135e96;
}

.view-icon {
    font-size: 16px;
    line-height: 1;
}

/* Sites Container */
.sites-container {
    transition: all 0.3s ease;
}

.sites-grid {
    padding: 10px 0;
}

.sites-grid-view {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    width: 100%;
}

/* Mobile: 1 column (default) */
.sites-grid-view .site-card {
    width: 100%;
    flex: 0 0 100%;
}

/* Medium screens: 2 columns */
@media (min-width: 768px) {
    .sites-grid-view .site-card {
        width: calc((100% - 25px) / 2);
        flex: 0 0 calc((100% - 25px) / 2);
    }
}

/* Large screens: 3 columns */
@media (min-width: 1024px) {
    .sites-grid-view .site-card {
        width: calc((100% - 50px) / 3);
        flex: 0 0 calc((100% - 50px) / 3);
    }
}

/* XL screens: 4 columns */
@media (min-width: 1280px) {
    .sites-grid-view .site-card {
        width: calc((100% - 75px) / 3);
        flex: 0 0 calc((100% - 75px) / 3);
    }
}

.sites-list {
    display: block;
    padding: 10px 0;
}

/* Sites Table */
.sites-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sites-table thead {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-bottom: 2px solid #dee2e6;
}

.sites-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #23282d;
    font-size: 14px;
    border-bottom: 2px solid #dee2e6;
    letter-spacing: 0.3px;
}

.sites-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

.sites-table th.sortable:hover {
    background-color: #e9ecef;
}

.sites-table th.sortable.sort-asc .sort-indicator::after {
    content: ' ▲';
    color: #2271b1;
}

.sites-table th.sortable.sort-desc .sort-indicator::after {
    content: ' ▼';
    color: #2271b1;
}

.sites-table th.sortable .sort-indicator::after {
    content: ' ⇅';
    color: #ccc;
    font-size: 12px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.sites-table th:not(:last-child) {
    border-right: 1px solid #e9ecef;
}

.sites-table td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    vertical-align: middle;
    color: #23282d;
}

.sites-table td:not(:last-child) {
    border-right: 1px solid #f0f0f0;
}

.sites-table tbody tr {
    background-color: #ffffff;
    position: relative;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.sites-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.sites-table tbody tr:hover {
    background-color: #f0f7ff;
    transform: translateX(2px);
}

.sites-table tbody tr:nth-child(even):hover {
    background-color: #f0f7ff;
}

/* Status indicator cell */
.sites-table tbody tr td.status-indicator {
    background-color: #e9ecef !important;
    vertical-align: middle;
}

.sites-table tbody tr.payment-status-paid td.status-indicator {
    background-color: #28a745 !important;
}

.sites-table tbody tr.payment-status-due td.status-indicator {
    background-color: #ffc107 !important;
}

.sites-table tbody tr.payment-status-overdue td.status-indicator {
    background-color: #dc3545 !important;
}

.sites-table tbody tr:last-child td {
    border-bottom: none;
}

.sites-table tfoot {
    background-color: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

.sites-table tfoot tr.table-footer {
    background-color: #e9ecef;
    font-weight: 600;
}

.sites-table tfoot td {
    padding: 14px 16px;
    border-top: 2px solid #dee2e6;
    font-size: 14px;
}

.sites-table small {
    color: #646970;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.sites-table .table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

/* Icon buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background-color: #f0f0f0;
    color: #646970;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon:hover {
    background-color: #2271b1;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-icon-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-icon-danger:hover {
    background-color: #dc3545;
    color: white;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.update-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.update-status-current {
    background-color: #d4edda;
    color: #155724;
}

.update-status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.update-status-error {
    background-color: #f8d7da;
    color: #721c24;
}

.update-status-unknown {
    background-color: #e2e3e5;
    color: #383d41;
}

@media (max-width: 1200px) {
    .sites-table {
        font-size: 12px;
    }
    
    .sites-table th,
    .sites-table td {
        padding: 10px 12px;
    }
    
    .sites-table .table-actions {
        gap: 6px;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
    }
    
    .btn-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .sites-grid-view {
        gap: 20px;
    }
}

/* Adjust gap for smaller screens */
@media (max-width: 767px) {
    .sites-grid-view {
        gap: 15px;
    }
}

.site-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 22px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.site-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.site-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.site-header h2 {
    font-size: 18px;
    color: #23282d;
    margin: 0;
}

.site-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.site-info {
    margin-bottom: 16px;
}

.site-info p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.site-info a {
    color: #2271b1;
    text-decoration: none;
}

.site-info a:hover {
    text-decoration: underline;
}

.site-updates {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.update-item {
    margin-bottom: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
}

.update-item form {
    margin-top: 8px;
}

.no-updates {
    color: #00a32a;
    font-weight: 500;
}

.empty-state {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.empty-state a {
    color: #2271b1;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Contract Info */
.contract-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.contract-info p {
    margin-bottom: 8px;
    font-size: 14px;
}

.payment-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}

.payment-status.payment-paid {
    background-color: #00a32a;
}

.payment-status.payment-due {
    background-color: #f0b849;
}

.payment-status.payment-overdue {
    background-color: #d63638;
}

/* Forms */
.form-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 30px;
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #23282d;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #646970;
    font-size: 12px;
}

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

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #23282d;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #646970;
    font-size: 18px;
    margin-bottom: 30px;
    font-weight: normal;
}

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

.update-modal.active {
    display: flex;
}

.update-modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
}

.update-modal-header {
    margin-bottom: 20px;
}

.update-modal-header h2 {
    margin: 0;
    color: #23282d;
    font-size: 20px;
}

.update-modal-body {
    margin-bottom: 20px;
}

.update-progress {
    margin-bottom: 15px;
}

.update-progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.update-progress-step.active {
    background-color: #e7f3ff;
    border-left: 3px solid #2271b1;
}

.update-progress-step.completed {
    background-color: #d4edda;
    border-left: 3px solid #00a32a;
}

.update-progress-step.failed {
    background-color: #f8d7da;
    border-left: 3px solid #d63638;
}

.update-progress-step-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.update-progress-step.active .update-progress-step-icon {
    color: #2271b1;
}

.update-progress-step.completed .update-progress-step-icon {
    color: #00a32a;
}

.update-progress-step.failed .update-progress-step-icon {
    color: #d63638;
}

.update-progress-step-text {
    flex: 1;
    font-size: 14px;
}

.update-progress-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.update-modal-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

.update-modal-message.info {
    background-color: #e7f3ff;
    color: #2271b1;
}

.update-modal-message.success {
    background-color: #d4edda;
    color: #155724;
}

.update-modal-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

.update-modal-message.warning {
    background-color: #fff3cd;
    color: #856404;
}

.update-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.update-modal-footer .btn {
    display: none;
}

.update-modal-footer .btn.show {
    display: inline-block;
}

/* Plugin Management Styles */
.plugin-info {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.plugin-info p {
    margin: 0.5rem 0;
}

.deploy-plugin-btn {
    margin: 0;
}

#deploy-modal,
#rum-deploy-form {
    margin-top: 1rem;
}

#sites-selection,
#rum-sites-selection {
    background-color: #fff;
    border-radius: 4px;
}

#sites-selection label,
#rum-sites-selection label {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 3px;
    transition: background-color 0.2s;
}

#sites-selection label:hover,
#rum-sites-selection label:hover {
    background-color: #f0f0f0;
}

#sites-selection input[type="checkbox"],
#rum-sites-selection input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Plugin table styles */
.sites-table code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Ensure first cell (status indicator) is properly styled */
.sites-table tbody tr td.status-indicator {
    padding: 0;
    width: 6px;
    min-width: 6px;
    border-right: none;
}

.sites-table thead th:first-child {
    padding: 0;
    width: 6px;
    min-width: 6px;
    border-right: none;
}

.sites-table tfoot td:first-child {
    padding: 0;
    width: 6px;
    min-width: 6px;
}

/* Ensure date input in table looks good */
.sites-table .payment-date-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sites-table .payment-date-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.sites-table .payment-date-input:hover {
    border-color: #999;
}

