/* ============================================ */
/* GALOSHA VOICE CALLING - STYLES */
/* Modern gradient design with animations */
/* ============================================ */

/* ============================================ */
/* RESET & GLOBALS */
/* ============================================ */

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

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 100vh;
}

/* ============================================ */
/* CONTAINER */
/* ============================================ */

.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 500px;
  padding: 40px;
  animation: fadeInUp 0.5s ease;
}

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

/* ============================================ */
/* HEADER */
/* ============================================ */

.header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.logo {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.tagline {
  color: #999;
  font-size: 14px;
  font-weight: 400;
}

/* ============================================ */
/* STATUS BAR */
/* ============================================ */

.status-bar {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 30px;
  text-align: center;
}

.status {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* ============================================ */
/* SCREENS */
/* ============================================ */

.screen {
  animation: fadeIn 0.3s ease;
}

.screen.hidden {
  display: none;
}

.screen-content {
  /* Content wrapper */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================ */
/* SECTIONS */
/* ============================================ */

.section {
  margin-bottom: 30px;
}

.section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.help-text {
  font-size: 14px;
  color: #999;
  margin-bottom: 15px;
}

/* ============================================ */
/* DIVIDER */
/* ============================================ */

.divider {
  display: flex;
  align-items: center;
  margin: 30px 0;
  color: #ccc;
  font-size: 14px;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.divider span {
  padding: 0 15px;
}

/* ============================================ */
/* INPUTS */
/* ============================================ */

.input {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  margin-bottom: 15px;
  font-family: inherit;
}

.input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input::placeholder {
  color: #bbb;
}

/* Lowercase input (for galosha codes) */
#galoshaCodeInput {
  text-transform: lowercase;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

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

.btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary button */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  transform: translateY(-2px);
}

/* Secondary button */
.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

/* Danger button */
.btn-danger {
  background: #e74c3c;
  color: white;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
  background: #c0392b;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

/* Control button (mute) */
.btn-control {
  background: #11998e;
  color: white;
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-control:hover {
  background: #0f8578;
  box-shadow: 0 6px 20px rgba(17, 153, 142, 0.6);
}

/* Small button */
.btn-small {
  padding: 10px 18px;
  font-size: 14px;
  width: auto;
}

/* Text button */
.btn-text {
  background: transparent;
  color: #667eea;
  box-shadow: none;
}

.btn-text:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* Disabled state */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================ */
/* SUCCESS ICON */
/* ============================================ */

.success-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 20px;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0%, 20%, 40%, 60%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: scale3d(.3, .3, .3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(.9, .9, .9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(.97, .97, .97);
  }
  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

/* ============================================ */
/* CODE DISPLAY */
/* ============================================ */

.code-display,
.link-display {
  margin-bottom: 20px;
}

.code-display label,
.link-display label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.code-value {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  user-select: all;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.link-input {
  margin-bottom: 10px;
  font-size: 14px;
  user-select: all;
}

/* ============================================ */
/* ANIMAL DISPLAY */
/* ============================================ */

.animal-display {
  text-align: center;
  margin-bottom: 30px;
}

.animal-emoji {
  font-size: 80px;
  margin-bottom: 10px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animal-name {
  font-size: 24px;
  font-weight: 600;
  color: #667eea;
}

/* ============================================ */
/* INFO BOX */
/* ============================================ */

.info-box {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.info-item:not(:last-child) {
  border-bottom: 1px solid #e0e0e0;
}

.info-label {
  font-size: 14px;
  color: #666;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* ============================================ */
/* WAITING STATUS */
/* ============================================ */

.waiting-status {
  text-align: center;
  padding: 30px;
  margin-bottom: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.waiting-status p {
  font-size: 16px;
  color: #666;
  font-weight: 500;
}

/* ============================================ */
/* CALL HEADER */
/* ============================================ */

.call-header {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border-radius: 15px;
  padding: 25px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.partner-display {
  text-align: center;
  margin-bottom: 15px;
}

.partner-emoji {
  font-size: 60px;
  margin-bottom: 8px;
}

.partner-name {
  font-size: 22px;
  font-weight: 600;
}

.call-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.call-duration {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.call-remaining {
  font-size: 14px;
  opacity: 0.9;
}

/* ============================================ */
/* CALL CONTROLS */
/* ============================================ */

.call-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* ============================================ */
/* CHAT SECTION */
/* ============================================ */

.chat-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
}

.chat-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

.chat-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.chat-messages {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding: 10px;
  background: white;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Chat message */
.chat-message {
  margin-bottom: 12px;
  animation: messageSlideIn 0.3s ease;
}

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

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}

.message-user {
  font-weight: 600;
}

.my-message .message-user {
  color: #11998e;
}

.other-message .message-user {
  color: #667eea;
}

.message-time {
  color: #999;
}

.message-text {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.my-message .message-text {
  background: #e8f5f3;
  color: #333;
}

.other-message .message-text {
  background: white;
  border: 1px solid #e0e0e0;
  color: #333;
}

/* Chat input */
.chat-input-container {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  margin-bottom: 0;
}

/* ============================================ */
/* ACTIONS */
/* ============================================ */

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

/* ============================================ */
/* JITSI CONTAINER (Hidden) */
/* ============================================ */

#jitsi-container {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

@media (max-width: 600px) {
  .container {
    padding: 30px 20px;
    border-radius: 15px;
  }
  
  .logo {
    font-size: 28px;
  }
  
  .animal-emoji {
    font-size: 60px;
  }
  
  .partner-emoji {
    font-size: 50px;
  }
  
  .code-value {
    font-size: 20px;
    letter-spacing: 2px;
  }
  
  .call-duration {
    font-size: 24px;
  }
  
  .chat-messages {
    max-height: 200px;
  }
}

@media (max-width: 400px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px 15px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 15px;
  }
  
  .input {
    padding: 12px 16px;
    font-size: 15px;
  }
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

.hidden {
  display: none !important;
}

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

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

.btn:focus,
.input:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================ */
/* PRINT STYLES */
/* ============================================ */

@media print {
  body {
    background: white;
  }
  
  .container {
    box-shadow: none;
  }
  
  .btn {
    display: none;
  }
}
