/* static/css/dashboard-style.css */

.ai-close-button {
    background-color: #00e6e6;
    color: #1a2a4c;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    line-height: 0.5;
}

.selected-question {
    font-weight: bold;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.ai-close-button:hover {
    background-color: #00b3b3;
    transition: all 0.3s ease;
}

body, .dashboard-card-container {
    font-family: 'Poppins', sans-serif;
}

.dashboard-container {
    width: 100%;
    min-height: calc(100vh - var(--header-height, 60px));
    margin: 0;
    padding: 25px;
    box-sizing: border-box;
    position: relative;
    background-color: #2e416a;
}

/* Grid layout only when showing cards */
.dashboard-container.has-preferences {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.dashboard-card-container {
    background-color: #1a2a4c;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: auto;
    height: auto;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}


.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.dashboard-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dashboard-header-right {
    flex-shrink: 0;
}

.dashboard-header-right img {
    border-radius: 50%;
}

.company-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.dashboard-card-header .ticker {
    font-size: 40px;
    font-weight: bold;
    color: #00e6e6;
    margin-bottom: 3px;
}

.dashboard-card-header .price {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
}

.company-name {
    font-size: 20px;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.2;
    max-height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}


.dashboard-card-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    margin-top: 20px;
}

.dashboard-card-details span{
    font-size: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.detail-label {
    font-size: 14px;
    color: #b0b7c3;
    font-family: 'Open Sans', sans-serif;
}

.detail-value {
    font-size: 14px;
    color: #e0e5eb;
    font-weight: 500;
    font-family: 'Open Sans', sans-serif;
}

.dashboard-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.change {
    font-size: 16px;
    font-weight: bold;
    font-family: 'Open Sans', sans-serif;
}

.change.positive {
    color: #25db55;
}

.change.negative {
    color: #e53e3e;
}

.view-details-btn {
    background-color: rgba(0, 230, 230, 0.2);
    color: #00e6e6;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 65px;
}

.view-details-btn:hover {
    background-color: rgba(1, 153, 153, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 230, 0.4);
}

.view-details-btn:active {
    transform: scale(0.95);
    background-color: rgba(0, 180, 180, 0.4);
    box-shadow: 0 0 10px rgba(0, 230, 230, 0.5);
}

@media (max-width: 1400px) {
    .dashboard-container.has-preferences {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-container.has-preferences {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
        padding: 15px;
    }
}

.welcome-message {
    background-color: #1a2a4c;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.welcome-content {
    color: #ffffff;
    line-height: 1.6;
    margin-top: 1.5rem;
}

.welcome-message h2 {
    color: #00e6e6;
    margin-bottom: 1.5rem;
    font-family: 'SUSE', sans-serif;
    font-size: 2rem;
}

.welcome-content p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.settings-link {
    color: #00e6e6;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s;
}

.settings-link:hover {
    color: #009999;
}

.settings-link:active {
    transform: scale(0.95);
    color: #009999;
}

.welcome-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.welcome-title {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.welcome-content {
    color: #34495e;
}

.welcome-intro {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.welcome-steps {
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.welcome-steps h3 {
    margin-top: 0;
    color: #2c3e50;
}

.welcome-steps ol {
    padding-left: 1.5rem;
    list-style-position: outside;

}

.welcome-cta {
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgb(26, 42, 76);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: rgb(75, 101, 154);
}

.btn-primary:active {
    transform: scale(0.95);
    background-color: rgb(75, 101, 154);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.dashboard-secondary-header {
    background-color: #23345a;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 20px;
}

.dashboard-header-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    flex: 1;
    justify-content: center;
    text-align: center;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #707070;
    color: #1a2a4c;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    cursor: pointer;
    position: relative;
}

.tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #707070;
    color: #ffffff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1005;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 12px;
    line-height: 1.4;
}

.info-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {
    .dashboard-secondary-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .dashboard-header-item {
        width: 100%;
        justify-content: center;
        margin-bottom: 0;
    }
}


.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-overlay p{
    color: white;
}

.popup-overlay h3{
    color: #00e6e6;
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
}

#companyInfo h3 {
    margin-top: 0px !important;  /* just in case */
}

.popup-overlay a{
    color: rgb(51, 102, 204);
    text-decoration: none;
}

.popup-overlay a:hover{
    cursor: pointer;
    text-decoration: underline;
}
  
.popup-content {
    background-color: #1a2a4c;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}
  
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 2px solid rgba(46, 65, 106, 0.6);
    background: linear-gradient(to right, #23345a, #2c3e68);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
  
.popup-header h2 {
    color: #00e6e6;
    font-size: 30px;
    font-weight: 1000;
    margin: 0;
    position: relative;
    transition: transform 0.3s ease;
    font-family: 'Lato', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
  
#closePopup {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}
  
#closePopup:hover {
    color: #00e6e6;
}
  
.popup-body {
    flex-grow: 1;
    padding: 20px 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popup-body::-webkit-scrollbar {
    width: 10px;
}

.popup-body::-webkit-scrollbar-track {
    background: #2e416a;
    border-radius: 5px;
}

.popup-body::-webkit-scrollbar-thumb {
    background: #4a5d8a;
    border-radius: 5px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
    background: #5a6d9a;
}

  
.hidden {
    display: none;
}
  
.recommendation-banner {
    background: linear-gradient(90deg, #2e416a, #1a2a4c);
    padding: 15px 25px;
    margin: 0;
    font-size: 16px;
    color: #ffffff;
    font-family: 'Open Sans', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recommendation-banner .buy {
    color: #00e676;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba(0, 230, 118, 0.1);
}

.recommendation-banner .sell {
    color: #ff4444;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba(255, 68, 68, 0.1);
}

.recommendation-banner .strong {
    font-weight: 700;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.recommendation-banner .strong::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    opacity: 0.6;
}
  
.btn-ai {
    background-color: #1fb348;
    color: #ffffff;
    border: none;
    padding: 10px 10px;
    padding-top: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(31, 179, 72, 0.3);
    height: 28px;
    width: 28px;
    justify-content: center;
    align-items: center;
    line-height: 0.5;
    margin-left: -10px;
    font-family: 'Outfit', sans-serif;
}

.btn-ai:hover {
    background-color: #179a3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 179, 72, 0.4);
}

.btn-ai:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(31, 179, 72, 0.2);
}

.btn-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.btn-ai:hover::before {
    left: 100%;
}

/* Company Info stays full width at top */
#companyInfo {
    width: 100%;
}

/* Create a grid container for the metrics sections */
.popup-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid layout for metric sections */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.metrics-grid h3, .companyInfo h3 {
    border-bottom: 2px solid rgba(46, 65, 106, 0.6);
}

.metrics-grid p, .companyInfo p {
    margin-top: 0px;
    margin-bottom: 2px; 
}

.marketData, .priceMetrics, .financialMetrics, .cashFlow, .growth, .dividendInfo {
    gap: 0px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

#aiResponseText {
    background-color: #1a2a4c;
    padding: 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e5eb;
    white-space: pre-wrap;
}

#backToQuestions {
    background-color: #00e6e6;
    color: #1a2a4c;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    margin-top: 20px;
}

#backToQuestions:hover {
    background-color: #00b3b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 230, 230, 0.3);
}

#backToQuestions:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 230, 230, 0.2);
}

#aiQuestionsPopup .popup-content {
    max-width: 600px;
    height: auto;
    max-height: 90vh;
}

#aiQuestionsPopup .popup-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-question-btn {
    background-color: rgba(0, 230, 230, 0.2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Poppins', sans-serif;
}

.ai-question-btn:hover {
    background-color: rgba(1, 153, 153, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 230, 0.4);
}

.ai-question-btn:active {
    transform: scale(0.98);
    background-color: rgba(0, 180, 180, 0.4);
    box-shadow: 0 0 10px rgba(0, 230, 230, 0.5);
}

#aiQuestions h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #00e6e6;
}