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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.logo {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748b;
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
}

.btn-login {
    width: 100%;
    background: #2563eb;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #1d4ed8;
}

.error-message {
    background: #fee;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.hint {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Dashboard styles */
.dashboard-container {
    display: none;
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    width: calc(100% - 4rem);
    max-width: 1200px;
    margin: 2rem auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dashboard-title {
    font-size: 1.75rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-box {
    background: #d1fae5;
    color: #047857;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.add-domain-btn {
    display: block;
    margin: 0 auto 1.5rem;
    background: #2563eb;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.add-domain-btn:hover {
    background: #1d4ed8;
}

.domain-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    position: relative;
}

.domain-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #3b82f6;
}

.section-header {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-name {
    font-size: 1.125rem;
    color: #1e293b;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
}

.domain-description {
    color: #64748b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-size: 0.875rem;
}

.domain-status {
    display: inline-block;
    background: #22c55e;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.jump-to-icon {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.jump-to-icon:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .domains-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-body form > div {
        grid-template-columns: 1fr !important;
    }
}

/* Modal Styles */
.modal-overlay, .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    color: #111827;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.125rem;
}

.image-upload-container {
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.upload-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.upload-controls-horizontal {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-start;
}

.preview-left {
    max-width: 100px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
}

.color-input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-preview-box {
    width: 40px;
    height: 40px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.color-preview-box:hover {
    border-color: #3b82f6;
}

.color-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.upload-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.upload-btn:hover {
    background: #2563eb;
}

.upload-status {
    font-size: 0.875rem;
    color: #6b7280;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f9fafb;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f3f4f6;
}