/**
 * FoksTech Components Styles
 * Buttons, 3D Tilt Cards, Services Cards, Project Cards, Support Chatbot, Preloader, Forms.
 */

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.45rem;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  text-decoration: none;
}

/* Primary Filled Cyan */
.btn-primary {
  background-color: var(--accent-primary);
  color: var(--text-inverse) !important;
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: var(--text-inverse) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-cyan);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Outlined */
.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Purple Gradient / Accent */
.btn-purple {
  background: var(--accent-secondary-faint);
  color: #C4B5FD;
  border-color: rgba(139, 92, 246, 0.4);
}

.btn-purple:hover {
  background-color: var(--accent-secondary);
  color: #FFFFFF !important;
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-purple);
}

/* Tertiary Text Link */
.btn-text {
  background: none;
  border: none;
  padding: var(--space-1) 0;
  color: var(--accent-primary);
  font-weight: var(--font-weight-semibold);
}

.btn-text:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
  transform: translateX(3px);
}

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 0.95rem 1.95rem;
  font-size: var(--font-size-base);
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   CARDS & 3D TILT CONTAINERS
   ========================================================================== */

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-interactive:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
}

/* Glowing Border Card */
.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-accent);
  opacity: 0.7;
}

/* Service Card Styles */
.service-card {
  background: var(--grad-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  height: 100%;
}

.service-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.service-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--grad-accent-subtle);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: var(--space-4);
}

.service-icon-box svg {
  width: 26px;
  height: 26px;
}

.service-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--text-main);
}

.service-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-5);
}

.service-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.service-checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-main);
}

.service-check-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* Project Card Styles */
.project-card {
  background: var(--grad-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.project-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.project-app-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.project-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-main);
  margin: 0 0 var(--space-1) 0;
}

.project-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-base);
  margin-bottom: var(--space-6);
  flex-grow: 1;
}

.project-card-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.project-preview-thumb {
  transition: transform var(--transition-normal);
}

.project-card:hover .project-preview-thumb {
  transform: scale(1.05);
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.28rem 0.7rem;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1.2;
  white-space: nowrap;
}

.badge-cyan {
  background-color: var(--accent-primary-faint);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
}

.badge-purple {
  background-color: var(--accent-secondary-faint);
  color: #C4B5FD;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.badge-muted {
  background-color: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: var(--font-size-base);
  color: var(--text-main);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--font-size-xs);
  color: #EF4444;
  display: none;
}

.form-control.is-invalid {
  border-color: #EF4444;
}

.form-control.is-invalid + .form-error {
  display: block;
}

/* Search Box Container */
.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  padding-left: 2.75rem;
  padding-right: 2.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  display: none;
}

.search-clear-btn.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding: var(--space-4);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.filter-pill {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.filter-pill.active {
  background-color: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
}

/* ==========================================================================
   SMART CHATBOT FLOATING WIDGET
   ========================================================================== */

#fokstech-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-chatbot);
  font-family: var(--font-family-sans);
}

.chatbot-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--grad-accent);
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-cyan), 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.chatbot-trigger:hover {
  transform: scale(1.08);
}

.chatbot-trigger.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.chatbot-trigger-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  animation: pulseChatRing 2.4s infinite cubic-bezier(0.45, 0, 0.55, 1);
  pointer-events: none;
}

@keyframes pulseChatRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 48px);
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow-cyan);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
  z-index: var(--z-chatbot);
}

.chatbot-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.chatbot-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-success);
  border: 2px solid var(--bg-card);
}

.chatbot-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-main);
  line-height: 1.2;
}

.chatbot-status-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

.chatbot-close:hover {
  color: var(--text-main);
}

/* Messages Area */
.chatbot-messages {
  flex: 1 1 auto;
  padding: var(--space-4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chatbot-msg {
  max-width: 84%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  line-height: 1.5;
  word-break: break-word;
}

.chatbot-msg p {
  margin-bottom: 0.4rem;
  color: inherit;
}

.chatbot-msg p:last-child {
  margin-bottom: 0;
}

.chatbot-msg-bot {
  align-self: flex-start;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: var(--radius-xs);
}

.chatbot-msg-user {
  align-self: flex-end;
  background: var(--grad-accent);
  color: #FFFFFF;
  border-bottom-right-radius: var(--radius-xs);
}

.chatbot-cta-row {
  align-self: flex-start;
  margin-top: 2px;
}

/* Typing Indicator */
.chatbot-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.9rem;
}

.chatbot-typing-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.chatbot-typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

/* Quick Replies */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
  max-height: 90px;
  overflow-y: auto;
}

.chatbot-quick-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chatbot-quick-pill:hover {
  background: var(--accent-primary-faint);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Chat Input Row */
.chatbot-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.chatbot-input {
  flex: 1 1 auto;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  outline: none;
}

.chatbot-input:focus {
  border-color: var(--accent-primary);
}

.chatbot-send-btn {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.chatbot-send-btn:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   PRELOADER / LOGO REVEAL INTRO
   ========================================================================== */

#site-preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  z-index: var(--z-preloader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  transition: opacity 350ms ease, visibility 350ms ease;
}

#site-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-symbol {
  width: 64px;
  height: 64px;
  animation: preloaderPulse 1.6s infinite ease-in-out;
}

.preloader-bar-wrapper {
  width: 140px;
  height: 3px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.preloader-bar-fill {
  width: 100%;
  height: 100%;
  background: var(--grad-accent);
  animation: preloaderFill 1.2s infinite ease-in-out;
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(0.96); filter: drop-shadow(0 0 10px var(--accent-primary-glow)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 25px var(--accent-primary)); }
}

@keyframes preloaderFill {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   ACCORDION (FAQ)
   ========================================================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item[open] {
  border-color: var(--border-accent);
}

.faq-summary {
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  gap: var(--space-4);
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-content {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.faq-item[open] .faq-content {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6) 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-muted);
  user-select: none;
}

.breadcrumb-item.active {
  color: var(--accent-primary);
  font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 580px;
  margin: var(--space-8) auto;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  color: var(--text-muted);
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--text-main);
}

.empty-state-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}
