@import "../components/cards/newsCard/newsCard.css";
@import "../components/cards/chartCard/chartCard.css";
@import "../components/cards/companyProfileCard/companyProfileCard.css";
body {
    font-family: Helvetica, Arial, sans;
    font-weight: 400;
    padding: 2rem;
    background-color: #e9e7e7;
  }

  img {
    max-width: 100px;
    max-height: 20px;
  }
  
  form {
    margin-bottom: 1rem;
  }
  
  input[type="text"] {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    border-right: none;
    outline: none;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-right: 0;
  }

  input[type="text"]:focus {
    border-color: #0078d7;
    box-shadow: 0 2px 8px rgba(0,120,215,0.10);
  }
  
  button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    margin-left: 0;
    border-radius: 0 4px 4px 0;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #0062b1;
  }

  button[type="submit"] {
    background-color: #f5f5f5;
  }
  
  .error {
    color: red;
  }

  .search-container {
    position: relative;
  }

  .search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  #ticker-form {
    width: fit-content;
  }

  #ticker-input-listbox{
    width: -webkit-fill-available;
  }

  #compare-search {
    width: -webkit-fill-available;
  }

  .search-result {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
  }

  .search-result:hover {
    background-color: #f5f5f5;
  }

  .search-result:last-child {
    border-bottom: none;
  }

  .search-result-ticker {
    font-weight: 600;
    font-size: 0.95rem;
  }

  .search-result-name {
    font-size: 0.85rem;
    color: #666;
  }

  .search-loading,
  .search-empty,
  .search-error {
    padding: 1rem;
    text-align: center;
    color: #666;
  }

  .search-error {
    color: #d32f2f;
  }

  .search-result.selected {
    background-color: #e3f2fd;
    outline: 2px solid #0078d7;
    outline-offset: -2px;
  }

  .search-result:focus {
    outline: 2px solid #0078d7;
    outline-offset: -2px;
  }

  button:focus,
  input:focus,
  select:focus {
    outline: 2px solid #0063b4;
    outline-offset: 2px;
  }

  /* Screen reader only class */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }

  .title-container {
    display: flex;
    align-items: center;
    justify-content: start;

    .title {
        padding-left: 10px;
        align-self: flex-end;
    }
  }

  #cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: fit-content;
    gap: 20px;
    background-color: #fafafa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    .cards-title {
      grid-column: 1 / -1;
      display: flex;
      border-bottom: 1px solid #ddd;
      justify-content: space-between;
    }
        img {
        max-width: 100px;
        max-height: 50px;
        align-self: center;
    }
}

.card {
    grid-column: span 2;
    padding: 20px;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-sizing: border-box;
    min-width: 28rem;
}

.card-header {
    font-size: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    height: 40px;
}

.card-footer {
    font-size: 1rem;
    border-top: 1px solid #ddd;
    height: 40px;
    
    a {
        text-decoration: none;
        color: #000000;
    }
}

@media (max-width: 1024px) {
  #cards-container {
    grid-template-columns: repeat(2, 1fr);

  }
    .card {
        grid-column: span 2;
    }
}