/* SendGrid Domain Checker - Main Styles */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #007cba;
}

h1 {
    color: #333;
    margin: 0;
    font-size: 28px;
}

h2, h3, h4 {
    color: #444;
}

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

.user-info {
    color: #666;
    font-size: 14px;
}

/* Button Styles */
.button {
    background-color: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.2s ease;
}

.button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.button-success { background-color: #28a745; }
.button-success:hover { background-color: #218838; }
.button-warning { background-color: #ffc107; color: #212529; }
.button-warning:hover { background-color: #e0a800; }
.button-warning:disabled { background-color: #6c757d; color: white; }
.button-small { padding: 8px 16px; font-size: 13px; }
.button-small.active { background-color: #0056b3; }

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

.filter-controls {
    display: flex;
    gap: 10px;
}

.results-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

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

.stat-item {
    text-align: center;
    padding: 15px;
    border-radius: 6px;
    background: white;
    border: 1px solid #dee2e6;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

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

.stat-success .stat-number { color: #28a745; }
.stat-warning .stat-number { color: #ffc107; }
.stat-error .stat-number { color: #dc3545; }

.completion-time {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.section {
    margin: 30px 0;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.missing-section {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-color: #fc8181;
}

.found-section {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-color: #68d391;
}

.errors-section {
    background: linear-gradient(135deg, #fffbf0 0%, #feebc8 100%);
    border-color: #f6ad55;
}

.section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.domain-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.domain-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.domain-card.missing {
    border-left: 4px solid #dc3545;
}

.domain-card.found {
    border-left: 4px solid #28a745;
}

.domain-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    word-break: break-all;
}

.domain-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.domain-id {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    color: #666;
}

.domain-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.domain-status.valid {
    background: #d4edda;
    color: #155724;
}

.domain-status.invalid {
    background: #f8d7da;
    color: #721c24;
}

.services-count {
    background: #e7f3ff;
    color: #007cba;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.results-actions {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.button-secondary {
    background-color: #6c757d;
    color: white;
}

.button-secondary:hover {
    background-color: #545b62;
}
.button-danger:hover { background-color: #c82333; }
.button-large {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
}

/* Info Box Styles */
.info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #007cba;
}

.config-status {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,124,186,0.3);
}

.status-good { color: #28a745; font-weight: 600; }
.status-error { color: #dc3545; font-weight: 600; }

.actions {
    text-align: center;
    margin: 30px 0;
}

code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", "Monaco", "Consolas", monospace;
}

ol, ul { padding-left: 20px; }
li { margin-bottom: 8px; }

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    max-width: 400px;
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-button {
    width: 100%;
    margin-top: 10px;
}

.error {
    color: #dc3545;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* Progress Page Styles */
.progress-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba 0%, #0056b3 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        rgba(255,255,255,0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.2) 75%,
        transparent 75%);
    background-size: 20px 20px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.current-task {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #007cba;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 50px;
}

.current-task.task-success {
    background: #d4f6d4;
    border-left-color: #28a745;
}

.current-task.task-error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.current-task.task-searching {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.time-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.log-container {
    margin: 30px 0;
}

.log {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    max-height: 400px;
    overflow-y: auto;
    font-family: "SF Mono", "Monaco", "Consolas", monospace;
    border: 1px solid #dee2e6;
    font-size: 13px;
    line-height: 1.5;
}

.log-entry {
    margin: 5px 0;
    padding: 2px 0;
}

.log-info { color: #333; }
.log-success { color: #28a745; font-weight: 500; }
.log-error { color: #dc3545; font-weight: 500; }
.log-warning { color: #ffc107; font-weight: 500; }

.controls {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.controls .button {
    margin: 0 10px;
}

.results-container {
    margin-top: 40px;
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.results-summary, .matches-section, .errors-section, .debug-section {
    margin: 20px 0;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.results-summary { background: #f8f9fa; }
.matches-section { background: #d4f6d4; }
.errors-section { background: #f8d7da; }
.debug-section { background: #fff3cd; }

.match-item, .error-item {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
}

.debug-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #dee2e6;
}

.debug-info pre {
    background: white;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
}