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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

.header h1 i {
    margin-right: 10px;
    color: #667eea;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    font-size: 14px;
    font-weight: 500;
    color: #718096;
}

.status-indicator.online {
    color: #48bb78;
}

.status-indicator.offline {
    color: #f56565;
}

.status-indicator i {
    margin-right: 5px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #edf2f7;
    transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-1px);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-1px);
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 20px;
}

.login-card h2 i {
    margin-right: 10px;
    color: #667eea;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Main Content */
.main-content {
    display: grid;
    gap: 50px;
}

/* Auto-refresh indicator */
.auto-refresh-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

.auto-refresh-indicator i {
    font-size: 16px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
}

section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

section h2 {
    margin-bottom: 25px;
    color: #2d3748;
    font-size: 20px;
    font-weight: 600;
}

section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.action-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.action-card h3 {
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.action-card h3 i {
    margin-right: 8px;
    color: #667eea;
}

.action-card p {
    margin-bottom: 20px;
    color: #718096;
    font-size: 14px;
}

.tenant-info {
    background: #edf2f7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.tenant-info .info-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.tenant-info .info-item:last-child {
    margin-bottom: 0;
}

.tenant-info .info-item strong {
    color: #2d3748;
    margin-right: 8px;
}

.tenant-info .info-item span {
    color: #4a5568;
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.r2-info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #4a5568;
}

.r2-info.can-backup {
    background: #f0fff4;
    border-left: 4px solid #48bb78;
    color: #2f855a;
}

.r2-info.cooldown {
    background: #fffaf0;
    border-left: 4px solid #ed8936;
    color: #c05621;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.download-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.download-card h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.download-card h3 i {
    margin-right: 8px;
    color: #667eea;
}

.download-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #edf2f7;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
}

.download-info .file-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.download-info .file-info span {
    display: block;
}

.download-info .file-info .filename {
    font-weight: 600;
    color: #2d3748;
    font-family: 'Courier New', monospace;
}

.history-controls {
    margin-bottom: 20px;
}

.history-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #f7fafc;
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: #edf2f7;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

tr:hover {
    background: #edf2f7;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #fef5e7;
    color: #d69e2e;
}

.status-badge.running {
    background: #ebf8ff;
    color: #3182ce;
}

.status-badge.completed {
    background: #f0fff4;
    color: #38a169;
}

.status-badge.failed {
    background: #fed7d7;
    color: #e53e3e;
}

/* Job Statistics */
.job-stats {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-icon.pending {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.stat-icon.running {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.completed {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.stat-icon.failed {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.job-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.job-item {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
}

.job-item.running {
    border-left: 4px solid #3182ce;
}

.job-info h4 {
    margin-bottom: 5px;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.job-info h4 i {
    margin-right: 8px;
    color: #667eea;
}

.job-info p {
    color: #718096;
    font-size: 14px;
}

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

.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 14px;
    color: #4a5568;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #48bb78;
    color: #2f855a;
}

.notification.error {
    border-left: 4px solid #f56565;
    color: #c53030;
}

.notification.info {
    border-left: 4px solid #4299e1;
    color: #2b6cb0;
}

.notification.warning {
    border-left: 4px solid #ed8936;
    color: #c05621;
}

.notification i {
    font-size: 16px;
}

.notification.success i {
    color: #48bb78;
}

.notification.error i {
    color: #f56565;
}

.notification.info i {
    color: #4299e1;
}

.notification.warning i {
    color: #ed8936;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #718096;
    font-style: italic;
}

.loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .action-grid,
    .download-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        margin: 20px;
    }

    .notifications {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .notification {
        font-size: 13px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    section {
        padding: 20px;
    }

    .action-card,
    .download-card {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

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

.text-muted {
    color: #718096;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

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

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: #718096;
    text-align: center;
    font-weight: 500;
}

.rsync-info {
    background: #edf2f7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.rsync-info .info-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.rsync-info .info-item:last-child {
    margin-bottom: 0;
}

.rsync-info .info-item strong {
    color: #2d3748;
    margin-right: 8px;
}

.rsync-info .info-item span {
    color: #4a5568;
} 