/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0073aa;
    --primary-dark: #005a87;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form {
    margin-top: 30px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: var(--primary-color);
    color: white;
}

.nav-item span {
    margin-right: 10px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    margin-bottom: 15px;
}

.user-info strong {
    display: block;
    margin-bottom: 5px;
}

.user-info small {
    display: block;
    opacity: 0.7;
    font-size: 11px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.content-header h1 {
    font-size: 28px;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.section-header p {
    color: var(--text-light);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 40px;
}

.stat-info h3 {
    font-size: 32px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.stat-info p {
    color: var(--text-light);
    font-size: 14px;
}

/* Info Box */
.info-box {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-box h3 {
    margin-bottom: 20px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-card h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-group select.select-multiple {
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 12px;
}

.form-group input[type="radio"] {
    margin-right: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Result Box */
.result-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 5px;
}

.result-box.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-box.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Test Results */
.test-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.test-results {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 200px;
}

.test-result-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid;
}

.test-result-item.success {
    background: #d4edda;
    border-left-color: var(--success-color);
}

.test-result-item.error {
    background: #f8d7da;
    border-left-color: var(--error-color);
}

.test-result-item h4 {
    margin-bottom: 10px;
}

.test-result-item pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 12px;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Notification Preview */
.notification-preview {
    margin-top: 30px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.preview-container {
    max-width: 400px;
    margin: 20px auto;
}

.notification-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.notification-site {
    font-size: 12px;
    color: var(--text-light);
}

.notification-body {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.4;
    margin-top: 8px;
}

.notification-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-top: 10px;
}

/* Small Preview */
.preview-container-small {
    margin: 15px 0;
}

.notification-card-small {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border-color);
    max-width: 300px;
}

.notification-header-small {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.notification-icon-small {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    object-fit: cover;
}

.notification-content-small {
    flex: 1;
}

.notification-title-small {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.notification-site-small {
    font-size: 10px;
    color: var(--text-light);
}

.notification-body-small {
    font-size: 11px;
    color: var(--text-color);
    line-height: 1.3;
    margin-top: 6px;
}

.notification-image-small {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 3px;
    margin-top: 8px;
}

/* Templates */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.template-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.template-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.template-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.template-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Readonly Input */
.readonly-input {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Button Variants */
.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Test Results */
.test-results {
    min-height: 150px;
}

/* Settings Cards */
.form-card h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* URL Fetch Container */
.url-fetch-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.url-input {
    flex: 1;
}

.fetch-status {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
}

.fetch-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.fetch-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fetch-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Domain Management */
.domain-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.domain-input {
    flex: 1;
}

.domains-list {
    min-height: 60px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: #f9f9f9;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.domain-tag-item {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    gap: 8px;
    font-size: 13px;
}

.domain-tag-item span {
    font-weight: 500;
}

.remove-domain-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-domain-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.no-domains-message {
    color: var(--text-light);
    font-style: italic;
    padding: 10px;
    text-align: center;
    width: 100%;
}

.domains-panel-list {
    margin-top: 20px;
}

.domains-table {
    overflow-x: auto;
}

.domains-table-content {
    width: 100%;
    border-collapse: collapse;
}

.domains-table-content th,
.domains-table-content td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.domains-table-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
}

.domains-table-content tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

