/*
 * This file is part of the UX SDC Bundle
 *
 * (c) Jozef Môstka <https://github.com/tito10047/ux-sdc>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/* Styles for CaseStudy component */


@layer components {
  .case-study {
    padding-block: var(--space-3xl);
    background: var(--color-bg);

    & .case-study__card {
      display: grid;
      grid-template-columns: 40% 60%;
      background: var(--color-surface);
      border: var(--border-thin);
      border-radius: var(--radius-m);
      overflow: hidden;

      @media (max-width: 992px) {
        grid-template-columns: 1fr;
      }
    }

    & .case-study__content {
      padding: var(--space-xl);
      display: flex;
      flex-direction: column;
    }

    & .case-study__tag {
      font-family: var(--font-mono);
      font-size: var(--size-step--2);
      color: var(--color-accent-blue);
      text-transform: uppercase;
      letter-spacing: 0.15em;
      font-weight: 700;
    }

    & .case-study__title {
      font-size: var(--size-step-3);
      color: var(--color-text-main);
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    & .case-study__description {
      font-size: var(--size-step-0);
      color: var(--color-text-muted);
      line-height: 1.6;
      max-width: 50ch;
    }

    & .case-study__specs {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: var(--space-m);
      padding-block: var(--space-m);
      border-block: var(--border-thin);
    }

    & .spec {
      display: flex;
      flex-direction: column;
      gap: var(--space-3xs);
    }

    & .spec__label {
      font-family: var(--font-mono);
      font-size: var(--size-step--2);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--color-accent-blue);
      font-weight: 700;
    }

    & .spec__value {
      font-size: var(--size-step--1);
      color: var(--color-text-muted);
      line-height: 1.5;
    }

    & .case-study__features {
      list-style: none;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: var(--space-xs);

      & li {
        font-family: var(--font-mono);
        font-size: var(--size-step--1);
        color: var(--color-text-muted);
        display: flex;
        align-items: center;
        gap: var(--space-s);
      }

      & li::before {
        content: "";
        width: 6px;
        height: 1px;
        background: var(--color-accent-blue);
      }
    }

    & .case-study__actions {
      margin-top: var(--space-s);

      & .btn--outline {
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: var(--space-s) var(--space-xl);

        &:hover {
          border-color: var(--color-accent-blue);
          color: var(--color-accent-blue);
          background: color-mix(in srgb, var(--color-accent-blue) 8%, transparent);
          box-shadow: 0 0 20px color-mix(in srgb, var(--color-accent-blue) 20%, transparent);
        }
      }
    }

    & .case-study__visual {
      background: #050505;
      border-left: var(--border-thin);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: var(--space-xl);
      min-height: 400px;

      @media (max-width: 992px) {
        border-left: none;
        border-top: var(--border-thin);
      }
    }

    & .terminal {
      width: 100%;
      background: #000;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      overflow: hidden;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    }

    & .terminal__header {
      background: #111;
      padding: 10px 16px;
      display: flex;
      align-items: center;
      gap: 16px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    & .terminal__dots {
      display: flex;
      gap: 6px;

      & span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
      }
    }

    & .terminal__title {
      font-family: var(--font-mono);
      font-size: 12px;
      color: #666;
    }

    & .terminal__body {
      padding: 24px;
      font-family: var(--font-mono);
      font-size: 14px;
      line-height: 1.6;
      overflow-x: auto;

      & pre {
        white-space: pre;
        width: max-content;
      }
    }

    & code {
      color: #d1d1d1;
    }

    & .code--comment { color: #555; }
    & .code--keyword { color: var(--color-accent-blue); }
    & .code--class { color: var(--color-accent-purple); }
    & .code--method { color: #EDEDED; }

    & .case-study__others {
      margin-top: var(--space-2xl);
      display: flex;
      flex-direction: column;
      gap: var(--space-m);
    }

    & .case-study__others-label {
      font-family: var(--font-mono);
      font-size: var(--size-step--2);
      color: var(--color-accent-blue);
      text-transform: uppercase;
      letter-spacing: 0.15em;
      font-weight: 700;
    }

    & .case-study__others-list {
      list-style: none;
      padding: 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: var(--space-m);
    }

    & .case-study__other-wrapper {
      display: flex;
      flex-direction: column;
    }

    & .case-study__other-item {
      display: flex;
      flex-direction: column;
      gap: var(--space-xs);
      text-decoration: none;
      border: var(--border-thin);
      border-radius: var(--radius-m);
      overflow: hidden;
      background: var(--color-surface);
      cursor: pointer;
      width: 100%;
      padding: 0;
      transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                  opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);

      &:hover {
        border-color: var(--color-accent-blue);
        opacity: 0.85;
      }

      &[aria-current="true"] {
        border-color: var(--color-accent-blue);
        box-shadow: 0 0 0 1px var(--color-accent-blue);
        pointer-events: none;

        & .case-study__other-title {
          color: var(--color-accent-blue);
        }

        & .case-study__other-image::after {
          content: "";
          position: absolute;
          inset: 0;
          background: rgba(59, 130, 246, 0.12);
        }
      }
    }

    & .case-study__other-image {
      position: relative;
      aspect-ratio: 16 / 9;
      overflow: hidden;
      background: var(--color-bg);

      & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }
    }

    & .case-study__other-title {
      font-family: var(--font-mono);
      font-size: var(--size-step--1);
      color: var(--color-text-muted);
      padding: var(--space-xs) var(--space-s);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .case-study__other-link {
    font-family: var(--font-mono);
    font-size: var(--size-step--2);
    color: #888888;
    text-decoration: none;
    padding: var(--space-2xs) var(--space-s);
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    &::after {
      content: "→";
      color: var(--color-accent-blue);
      transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      display: inline-block;
    }

    &:hover {
      color: var(--color-accent-blue);

      &::after {
        transform: translateX(3px);
      }
    }
  }
}
