/* WNF 2.0 - Main Styles */
/* Глобальные стили для всего приложения */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
  color: #fff;
}

/* Main App Container */
#wnf-app {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Template Library Container */
#template-library-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

#template-library-container::-webkit-scrollbar {
  width: 8px;
}

#template-library-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

#template-library-container::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 4px;
}

/* Canvas Container */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  z-index: 1;
}

#canvas-container.active {
  display: block;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* System Manager Container */
#system-manager-container {
  display: none;
  z-index: 500;
}

/* Setup Modal Container */
#setup-modal-container {
  z-index: 10000;
}

/* Top Navigation Header */
.wnf-nav-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.wnf-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #00d4ff;
}

.wnf-nav-logo span {
  font-size: 28px;
}

.wnf-nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.wnf-nav-email {
  color: #888;
  font-size: 14px;
}

.wnf-nav-logout {
  padding: 8px 16px;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: 8px;
  color: #ff6666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wnf-nav-logout:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.5);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.flex {
  display: flex !important;
}

.text-center {
  text-align: center;
}

.text-primary {
  color: #00d4ff;
}

.text-secondary {
  color: #888;
}

.text-success {
  color: #00ff00;
}

.text-error {
  color: #ff4444;
}

.text-warning {
  color: #ffd700;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 212, 255, 0.2);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 20000;
}

.loading-overlay .loading-spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-overlay p {
  color: #888;
  font-size: 16px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 15000;
}

.toast {
  padding: 15px 20px;
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  border-color: rgba(0, 255, 0, 0.3);
}

.toast-success::before {
  content: '✅';
}

.toast-error {
  border-color: rgba(255, 0, 0, 0.3);
}

.toast-error::before {
  content: '❌';
}

.toast-warning {
  border-color: rgba(255, 200, 0, 0.3);
}

.toast-warning::before {
  content: '⚠️';
}

.toast-info {
  border-color: rgba(0, 212, 255, 0.3);
}

.toast-info::before {
  content: 'ℹ️';
}

/* Global Button Styles */
.wnf-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.wnf-btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #000;
}

.wnf-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
}

.wnf-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wnf-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.wnf-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.wnf-btn-danger {
  background: rgba(255, 0, 0, 0.2);
  color: #ff6666;
  border: 1px solid rgba(255, 0, 0, 0.3);
}

.wnf-btn-danger:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 0, 0, 0.5);
}

/* Global Input Styles */
.wnf-input {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
}

.wnf-input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.wnf-input::placeholder {
  color: #666;
}

.wnf-select {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d4ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  width: 100%;
}

.wnf-select:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.wnf-select option {
  background: #1a1a2e;
  color: #fff;
}

/* Card Style */
.wnf-card {
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
}

.wnf-card:hover {
  border-color: #00d4ff;
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .wnf-nav-header {
    height: 50px;
    padding: 0 15px;
  }

  .wnf-nav-logo {
    font-size: 16px;
  }

  .wnf-nav-logo span {
    font-size: 22px;
  }

  .wnf-nav-email {
    display: none;
  }
}

/* Print Styles */
@media print {
  .wnf-nav-header,
  #system-manager-container,
  #setup-modal-container {
    display: none !important;
  }

  #canvas-container {
    position: static;
  }
}
