/**
 * Personal 2FA - Styles
 * Build: 2025-10-26T15:05:04.629Z
 * Mobile-first responsive design
 */

/**
 * Personal 2FA - Secure Local 2FA Application
 * Styles for mobile-first responsive design
 */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  color: #333;
}

/* Notification System Styles */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
  width: 100%;
  pointer-events: none;
}

.notification {
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  overflow: hidden;
  border-left: 4px solid #007bff;
}

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

.notification.notification-hide {
  opacity: 0;
  transform: translateX(100%);
}

.notification-info {
  border-left-color: #007bff;
}

.notification-success {
  border-left-color: #28a745;
}

.notification-warning {
  border-left-color: #ffc107;
}

.notification-error {
  border-left-color: #dc3545;
}

.notification-progress {
  border-left-color: #6f42c1;
}

.notification-confirm {
  border-left-color: #fd7e14;
  max-width: 450px;
}

.notification-content {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: #f5f5f5;
  color: #333;
}

.progress-bar {
  height: 3px;
  background: #f0f0f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6f42c1, #8a63d2);
  width: 0;
  transition: width 0.3s ease;
  animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Confirm Dialog Styles */
.confirm-content {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.confirm-title {
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

.confirm-message {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  padding-left: 30px;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-left: 30px;
}

.btn-confirm-cancel,
.btn-confirm-ok,
.btn-cancel,
.btn-confirm {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.btn-confirm-cancel,
.btn-cancel {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.btn-confirm-cancel:hover,
.btn-cancel:hover {
  background: #e9ecef;
  color: #495057;
}

.btn-confirm-ok,
.btn-confirm {
  background: #007bff;
  color: white;
}

.btn-confirm-ok:hover,
.btn-confirm:hover {
  background: #0056b3;
}

/* Factory Reset Specific Styles */
.factory-reset-confirm {
  border-left-color: #dc3545;
  box-shadow: 0 12px 48px rgba(220, 53, 69, 0.3);
}

.factory-reset-confirm .confirm-title {
  color: #dc3545;
  font-weight: 700;
}

.factory-reset-confirm .notification-icon {
  font-size: 24px;
  animation: warningPulse 2s infinite;
}

.factory-reset-input input {
  border-color: #dc3545 !important;
  font-family: monospace;
  font-weight: bold;
  text-align: center;
}

.factory-reset-input input:focus {
  outline: none;
  border-color: #b02a37 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

@keyframes warningPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .notification {
    transform: translateY(-100%);
  }
  
  .notification.notification-show {
    transform: translateY(0);
  }
  
  .notification.notification-hide {
    transform: translateY(-100%);
  }
}

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

/* Security Header */
.security-header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.security-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

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

.language-selector select {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  height: 30px;
  display: flex;
  align-items: center;
  margin: 0;
  vertical-align: middle;
}

.language-selector select:hover {
  background: rgba(255, 255, 255, 0.3);
}

.language-selector option {
  background: #2a5298;
  color: white;
}

.security-header h1 {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
}

.security-indicators {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.indicator {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Main App Container */
.app-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Screen Management */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Cards */
.setup-card,
.login-card,
.loading-card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin: 40px auto;
  max-width: 500px;
}

/* Loading Screen */
.loading-card {
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.setup-card h2,
.login-card h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #2a5298;
}

/* Security Notice */
.security-notice {
  background: #e8f5e8;
  border: 2px solid #4caf50;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.security-notice h3 {
  color: #2e7d32;
  margin-bottom: 10px;
}

.security-notice ul {
  color: #2e7d32;
  line-height: 1.6;
  list-style: none;
}

/* Form Styles */
.password-setup {
  margin-top: 20px;
}

.password-setup label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 15px;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2a5298;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-action {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-primary {
  background: #2a5298;
  color: white;
}

.btn-primary:hover {
  background: #1e3c72;
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  background: #5a6268;
}

.btn-action {
  background: #28a745;
  color: white;
  margin: 5px;
}

.btn-action:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-2px);
}

.btn-danger:active {
  transform: translateY(0);
  background: #bd2130;
}

/* Active button state */
.btn-action.active,
.btn-secondary.active {
  background: #1e3c72;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

/* Action Bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Sections */
.section {
  background: white;
  border-radius: 15px;
  padding: 25px;
  margin: 20px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  scroll-margin-top: 20px; /* Adds space when scrolling to the section */
}

.section h3 {
  color: #2a5298;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.section.hidden {
  display: none;
}

.section:not(.hidden) {
  animation: slideInFade 0.3s ease-out;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Data Management */
.data-management-content {
  margin-top: 20px;
}

.dev-options {
  border: 2px solid #17a2b8;
  border-radius: 10px;
  padding: 20px;
  background: #f0f8ff;
  margin-bottom: 20px;
}

.dev-options h4 {
  color: #17a2b8;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.option-item {
  margin-bottom: 15px;
}

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  background-color: #ccc;
  border-radius: 24px;
  margin-right: 12px;
  transition: background-color 0.3s ease;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
  background-color: #2a5298;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-text {
  font-weight: 600;
  color: #333;
}

.option-description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  margin-left: 62px;
}

.warning-box {
  border: 2px solid #dc3545;
  border-radius: 10px;
  padding: 20px;
  background: #fff5f5;
  margin-bottom: 20px;
}

.warning-box h4 {
  color: #dc3545;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.warning-text {
  color: #721c24;
  margin-bottom: 15px;
  line-height: 1.5;
}

.warning-text strong {
  font-weight: 700;
}

/* Factory Reset Zone */
.factory-reset-box {
  border: 3px solid #9d2933;
  border-radius: 10px;
  padding: 20px;
  background: #4a0e13;
  background: linear-gradient(135deg, #4a0e13 0%, #6d1319 100%);
  margin-top: 20px;
  color: white;
  position: relative;
  box-shadow: 0 0 20px rgba(157, 41, 51, 0.5);
  animation: dangerPulse 3s infinite;
}

@keyframes dangerPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(157, 41, 51, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(157, 41, 51, 0.8);
  }
}

.factory-reset-box h4 {
  color: #ff6b6b;
  margin-bottom: 15px;
  font-size: 1.2rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.factory-reset-text {
  color: #ffcccc;
  margin-bottom: 15px;
  line-height: 1.5;
}

.factory-reset-list {
  background: rgba(0,0,0,0.3);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  list-style: none;
}

.factory-reset-list li {
  color: #ffdddd;
  margin-bottom: 8px;
  padding-left: 10px;
}

.factory-reset-text strong {
  font-weight: 700;
  color: #ff9999;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-factory-reset {
  background: linear-gradient(135deg, #9d2933 0%, #c62d42 100%);
  color: white;
  padding: 15px 25px;
  border: 2px solid #ff6b6b;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 4px 8px rgba(157, 41, 51, 0.3);
}

.btn-factory-reset:hover {
  background: linear-gradient(135deg, #c62d42 0%, #e74c3c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(157, 41, 51, 0.4);
}

.btn-factory-reset:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(157, 41, 51, 0.3);
}

.btn-factory-reset::before {
  content: "⚠️";
  margin-right: 8px;
  font-size: 18px;
  animation: shake 2s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Import Section */
.import-method {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid #e9ecef;
}

.import-method h4 {
  color: #2a5298;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.import-method p {
  color: #666;
  margin-bottom: 15px;
  font-size: 0.95em;
}

.json-import {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-file {
  color: #28a745;
  font-size: 0.9em;
  font-weight: 500;
  margin-left: 10px;
}

.selected-file:empty {
  display: none;
}

/* QR Scanner */
.qr-scanner {
  text-align: center;
  margin: 20px 0;
}

#qr-video {
  width: 100%;
  max-width: 400px;
  border-radius: 10px;
  border: 3px solid #2a5298;
}

.scan-status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  background: #f8f9fa;
}

/* Export Section */
.export-notice {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  color: #856404;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-result {
  margin-top: 20px;
  text-align: center;
}

/* TOTP Codes */
.totp-list {
  display: grid;
  gap: 15px;
}

.totp-item {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
}

.totp-item.deleting {
  animation: slideOutRight 0.5s ease-in-out forwards;
}

@keyframes slideOutRight {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

.totp-item:hover {
  border-color: #2a5298;
  box-shadow: 0 5px 15px rgba(42, 82, 152, 0.1);
}

.totp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.totp-info {
  flex: 1;
}

.totp-service {
  font-weight: 600;
  color: #2a5298;
  font-size: 1.1rem;
}

.totp-account {
  color: #6c757d;
  font-size: 0.9rem;
}

.totp-delete-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 10px;
  flex-shrink: 0;
}

.totp-delete-btn:hover {
  background: #c82333;
  transform: scale(1.1);
}

.totp-delete-btn:active {
  transform: scale(0.95);
}

/* Tooltip for delete button */
.totp-delete-btn {
  position: relative;
}

.totp-delete-btn:hover::after {
  content: attr(title);
  position: absolute;
  top: -35px;
  right: 0;
  background: #333;
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0.9;
}

.totp-code {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: bold;
  color: #28a745;
  text-align: center;
  letter-spacing: 3px;
  margin: 15px 0;
  cursor: pointer;
  user-select: all;
}

.totp-timer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-progress {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
  transition: width 1s linear;
}

.timer-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6c757d;
}

/* Manual Add Form */
.advanced-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.advanced-options label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state p {
  margin-bottom: 10px;
}

/* Security Panel (Development) */
.security-panel {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px;
  border-radius: 10px;
  font-size: 0.8rem;
  max-width: 300px;
  z-index: 1000;
}

.security-panel h4 {
  margin-bottom: 10px;
  color: #28a745;
}

/* Error Messages */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  display: none;
}

.error-message.show {
  display: block;
}

/* Success Messages */
.success-message {
  background: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .security-header .container {
    flex-direction: column;
    text-align: center;
  }
  
  .security-indicators {
    justify-content: center;
  }
  
  .action-bar {
    flex-direction: column;
  }
  
  .btn-action {
    width: 100%;
  }
  
  .totp-code {
    font-size: 1.5rem;
  }
  
  .advanced-options {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 0 10px;
  }
  
  .setup-card,
  .login-card {
    padding: 20px;
    margin: 20px auto;
  }
  
  .totp-code {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }
}