/* Login Screen Styles */

/* Glitch Text Efekti */
.glitch {
  position: relative;
  font-family: "Syne Mono", "JetBrains Mono", monospace;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary-700);
  text-transform: uppercase;
  background: linear-gradient(100deg, #0B1020 0%, #152B63 25%, #1E3A8A 55%, #2546A9 75%, #3B82F6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.25);
}

body.dark .glitch {
  background: linear-gradient(100deg, #F3F4F6 0%, #E5E7EB 25%, #D1D5DB 55%, #9CA3AF 75%, #6B7280 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.15);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glitch::before {
  left: 2px;
  text-shadow: var(--before-shadow);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-before var(--before-duration) infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: var(--after-shadow);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-after var(--after-duration) infinite linear alternate-reverse;
}

.glitch.enable-on-hover:hover::before {
  animation-duration: 0.3s;
}

.glitch.enable-on-hover:hover::after {
  animation-duration: 0.2s;
}

@keyframes glitch-anim-before {
  0% { clip: rect(31px, 9999px, 94px, 0); }
  20% { clip: rect(33px, 9999px, 14px, 0); }
  40% { clip: rect(43px, 9999px, 37px, 0); }
  60% { clip: rect(26px, 9999px, 75px, 0); }
  80% { clip: rect(2px, 9999px, 97px, 0); }
  100% { clip: rect(76px, 9999px, 33px, 0); }
}

@keyframes glitch-anim-after {
  0% { clip: rect(65px, 9999px, 100px, 0); }
  20% { clip: rect(79px, 9999px, 85px, 0); }
  40% { clip: rect(66px, 9999px, 4px, 0); }
  60% { clip: rect(98px, 9999px, 40px, 0); }
  80% { clip: rect(1px, 9999px, 60px, 0); }
  100% { clip: rect(80px, 9999px, 87px, 0); }
}

/* Login Screen Container */
.login-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  background: var(--bg);
  font-family: 'Google Sans Code', monospace;
}

body.authenticated .login-modal {
  display: none !important;
}

.login-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waves-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.waves-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Cubes container (replaces waves) */
.cubes-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.modal-card {
  position: relative;
  z-index: 2;
  width: 450px;
  max-width: 90vw;
  height: 600px;
  max-height: 90vh;
  perspective: 1000px;
  transform-style: preserve-3d;
  background: transparent;
}

.modal-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
  transform-origin: center center;
  background: transparent;
}

.modal-card.flipped .modal-card-inner {
  transform: rotateY(180deg);
}

.modal-face {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  will-change: transform;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

body.dark .modal-face {
  background: rgba(15, 23, 42, 0.95);
}

.modal-face-front {
  transform: rotateY(0deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 2;
}

.modal-face-back {
  transform: rotateY(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 1;
}

/* Toggle Switch - Brutalist Style */
.modal-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.modal-toggle::before {
  content: 'Giriş';
  font-size: 12px;
  font-weight: 600;
  color: var(--font-color-sub, #666);
  font-family: 'Syne Mono', monospace;
  pointer-events: none;
}

.modal-card.flipped .modal-toggle::before {
  content: 'Kayıt';
}

/* Switch - Brutalist Style */
.modal-toggle .switch {
  --switch_width: 2em;
  --switch_height: 1em;
  --thumb_color: #e8e8e8;
  --track_color: #e8e8e8;
  --track_active_color: #888;
  --outline_color: #000;
  
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: var(--switch_width);
  height: var(--switch_height);
  flex-shrink: 0;
}

body.dark .modal-toggle .switch {
  --thumb_color: #1a1a1a;
  --track_color: #1a1a1a;
  --track_active_color: #666;
  --outline_color: #fff;
}

/* Hide default HTML checkbox */
.modal-toggle .switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* The slider */
.modal-toggle .switch .slider {
  box-sizing: border-box;
  border: 2px solid var(--outline_color);
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--track_color);
  transition: .15s;
  border-radius: var(--switch_height);
}

.modal-toggle .switch .slider:before {
  box-sizing: border-box;
  position: absolute;
  content: "";
  height: var(--switch_height);
  width: var(--switch_height);
  border: 2px solid var(--outline_color);
  border-radius: 100%;
  left: -2px;
  bottom: -2px;
  background-color: var(--thumb_color);
  transform: translateY(-0.2em);
  box-shadow: 0 0.2em 0 var(--outline_color);
  transition: .15s;
}

.modal-toggle .switch input:checked + .slider {
  background-color: var(--track_active_color);
}

.modal-toggle .switch input:focus-visible + .slider {
  box-shadow: 0 0 0 2px var(--track_active_color);
}

/* Raise thumb when hovered */
.modal-toggle .switch input:hover + .slider:before {
  transform: translateY(-0.3em);
  box-shadow: 0 0.3em 0 var(--outline_color);
}

.modal-toggle .switch input:checked + .slider:before {
  transform: translateX(calc(var(--switch_width) - var(--switch_height))) translateY(-0.2em);
}

/* Raise thumb when hovered & checked */
.modal-toggle .switch input:hover:checked + .slider:before {
  transform: translateX(calc(var(--switch_width) - var(--switch_height))) translateY(-0.3em);
  box-shadow: 0 0.3em 0 var(--outline_color);
}

/* Login/Register Title */
.modal-title {
  text-align: center;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.modal-title .brand-title {
  margin: 0;
  font-size: 36px;
  font-weight: 900;
  color: var(--font-color, #323232);
  font-family: 'Google Sans Code', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.modal-title h2 {
  margin: 0;
  margin-top: 16px;
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  font-family: 'Google Sans Code', monospace;
}

/* Form Styles - Brutalist Design */
.brutalist-form {
  --input-focus: #2d8cf0;
  --font-color: #323232;
  --font-color-sub: #666;
  --bg-color: beige;
  --main-color: black;
  
  padding: 40px;
  background: lightblue;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 20px;
  border-radius: 16px;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
}

body.dark .brutalist-form {
  --bg-color: #1a1a1a;
  --font-color: #e0e0e0;
  --font-color-sub: #999;
  --main-color: #fff;
  background: #0f172a;
}

.brutalist-form .title {
  color: var(--font-color);
  font-weight: 900;
  font-size: 24px;
  margin-bottom: 0;
  margin-top: 0;
  width: 100%;
  text-align: left;
  font-family: 'Syne Mono', monospace;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.brutalist-form .title span {
  color: var(--font-color-sub);
  font-weight: 600;
  font-size: 17px;
}

.brutalist-form .input {
  width: 100%;
  height: 40px;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  box-shadow: 4px 4px var(--main-color);
  font-size: 15px;
  font-weight: 600;
  color: var(--font-color);
  padding: 5px 10px;
  outline: none;
  box-sizing: border-box;
  font-family: 'Google Sans Code', monospace;
}

.brutalist-form .input::placeholder {
  color: var(--font-color-sub);
  opacity: 0.8;
}

.brutalist-form .input:focus {
  border: 2px solid var(--input-focus);
}

.brutalist-form .login-with {
  display: flex;
  gap: 20px;
  width: 100%;
}

.brutalist-form .button-log {
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 100%;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  box-shadow: 4px 4px var(--main-color);
  color: var(--font-color);
  font-size: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.1s;
}

.brutalist-form .button-log .icon {
  width: 24px;
  height: 24px;
  fill: var(--main-color);
}

.brutalist-form .button-log:active,
.brutalist-form .button-confirm:active {
  box-shadow: 0px 0px var(--main-color);
  transform: translate(3px, 3px);
}

.brutalist-form .button-confirm {
  margin: 20px auto 0 auto;
  width: 120px;
  height: 40px;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  box-shadow: 4px 4px var(--main-color);
  font-size: 17px;
  font-weight: 600;
  color: var(--font-color);
  cursor: pointer;
  font-family: 'Google Sans Code', monospace;
  transition: all 0.1s;
  flex-shrink: 0;
}

.brutalist-form .button-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.brutalist-form .button-confirm:disabled:active {
  box-shadow: 4px 4px var(--main-color);
  transform: none;
}

.form-group textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 16px;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  box-shadow: 4px 4px var(--main-color);
  font-size: 15px;
  font-weight: 600;
  color: var(--font-color);
  resize: vertical;
  font-family: 'Google Sans Code', monospace;
  outline: none;
  box-sizing: border-box;
}

.form-group textarea:focus {
  border: 2px solid var(--input-focus);
}

/* Captcha - Brutalist Style */
.brutalist-form .captcha-group {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.brutalist-form .captcha-question {
  flex: 1;
  font-weight: 600;
  color: var(--font-color);
  font-family: 'Google Sans Code', monospace;
}

.brutalist-form .captcha-input {
  width: 110px;
  height: 40px;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
  box-shadow: 4px 4px var(--main-color);
  font-size: 15px;
  font-weight: 600;
  color: var(--font-color);
  padding: 5px 10px;
  outline: none;
  box-sizing: border-box;
}

.brutalist-form .captcha-input:focus {
  border: 2px solid var(--input-focus);
}

/* Buttons - Brutalist Design */
.modal-btn {
  margin: 50px auto 0 auto;
  width: 120px;
  height: 40px;
  border-radius: 5px;
  border: 2px solid var(--main-color, black);
  background-color: var(--bg-color, beige);
  box-shadow: 4px 4px var(--main-color, black);
  font-size: 17px;
  font-weight: 600;
  color: var(--font-color, #323232);
  cursor: pointer;
  font-family: 'Google Sans Code', monospace;
  transition: all 0.1s;
  flex-shrink: 0;
}

.modal-btn:active {
  box-shadow: 0px 0px var(--main-color, black);
  transform: translate(3px, 3px);
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-btn:disabled:active {
  box-shadow: 4px 4px var(--main-color, black);
  transform: none;
}

.modal-btn-secondary {
  background-color: var(--bg-color);
  color: var(--font-color);
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
}

.modal-btn-secondary:active {
  box-shadow: 0px 0px var(--main-color);
  transform: translate(3px, 3px);
}

/* Error/Success Messages - Brutalist Style */
.brutalist-form .modal-message {
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 0;
  display: none;
  font-size: 14px;
  font-family: 'Google Sans Code', monospace;
  flex-shrink: 0;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  width: 100%;
  box-sizing: border-box;
}

.brutalist-form .modal-message.show {
  display: block;
}

.brutalist-form .modal-message.error {
  background: #fee;
  color: #c33;
  border-color: #c33;
}

.brutalist-form .modal-message.success {
  background: #efe;
  color: #363;
  border-color: #363;
}

/* Password Strength Indicator - Brutalist Style */
.brutalist-form .password-strength {
  margin-top: 6px;
  height: 4px;
  background: var(--bg-color);
  border: 1px solid var(--main-color);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.2s ease, background 0.2s ease;
  background: #dc3545;
}

.password-strength-bar.weak {
  width: 30%;
  background: #dc3545;
}

.password-strength-bar.medium {
  width: 60%;
  background: #fd7e14;
}

.password-strength-bar.strong {
  width: 85%;
  background: #28a745;
}

.password-strength-bar.verystrong {
  width: 100%;
  background: #198754;
}

/* Link Styles - Brutalist */
.brutalist-form .modal-link {
  text-align: center;
  margin-top: 0;
  font-size: 14px;
  color: var(--font-color-sub);
  font-family: 'Google Sans Code', monospace;
  flex-shrink: 0;
  width: 100%;
}

.brutalist-form .modal-link a {
  color: var(--font-color);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 200ms linear;
}

.brutalist-form .modal-link a:hover {
  text-decoration: underline;
}

/* Login Footer */
.login-footer {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--font-color-sub);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Google Sans Code', monospace;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
  .modal-card {
    width: 90%;
    max-width: 450px;
    height: auto;
    min-height: 500px;
  }
  
  .modal-face {
    padding: 32px 24px;
  }
  
  .glitch {
    font-size: 36px;
  }
  
  .login-footer {
    font-size: 12px;
    bottom: 16px;
  }
}
