/* Convert365Online - Custom CSS */
/* Sử dụng Tailwind CDN cho phần lớn styling, chỉ thêm custom CSS cần thiết */

/* Dark mode variables */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
}

/* Base styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Improve contrast in dark mode */
[data-theme="dark"] .text-gray-300 { color: #e5e7eb; }
[data-theme="dark"] .text-gray-400 { color: #d1d5db; }
[data-theme="dark"] .border-gray-700 { border-color: #475569; }
[data-theme="dark"] .bg-gray-800 { background-color: #0f172a; }
[data-theme="dark"] .bg-gray-700 { background-color: #111827; }

/* Banner thông báo */
.notification-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  position: relative;
}

.notification-banner .close-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.25rem;
}

/* Ad placeholders */
.ad-placeholder {
  background: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), 
              linear-gradient(-45deg, #f1f5f9 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f1f5f9 75%), 
              linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  min-height: 120px;
  border-radius: 0.5rem;
}

[data-theme="dark"] .ad-placeholder {
  background: linear-gradient(45deg, #334155 25%, transparent 25%), 
              linear-gradient(-45deg, #334155 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #334155 75%), 
              linear-gradient(-45deg, transparent 75%, #334155 75%);
  border-color: #475569;
}

/* Tool cards */
.tool-card {
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Pro tool badge */
.pro-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

/* File upload area */
.upload-area {
  border: 2px dashed var(--border-color);
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.05);
}

/* Loading spinner */
.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  height: 4px;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background-color: var(--success-color);
}

.toast.error {
  background-color: var(--error-color);
}

.toast.warning {
  background-color: var(--warning-color);
}

.toast.info {
  background-color: var(--primary-color);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .ad-placeholder {
    min-height: 100px;
    font-size: 0.75rem;
  }
  
  .tool-card {
    margin-bottom: 1rem;
  }

  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles */
.focus-visible:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Admin styles */
.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
}

.admin-content {
  background: var(--bg-primary);
  min-height: 100vh;
}

.admin-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Pro tool specific styles */
.pro-tool-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.daily-limit-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

[data-theme="dark"] .daily-limit-warning {
  background: #451a03;
  border-color: #d97706;
  color: #fbbf24;
}

/* FAQ styles */
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.faq-question {
  padding: 1rem;
  cursor: pointer;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background: var(--border-color);
}

.faq-answer {
  padding: 0 1rem 1rem;
  display: none;
}

.faq-answer.show {
  display: block;
}

/* Responsive grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}
