src/main/resources/static/css/home.css
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    background: linear-gradient(90deg, #e2e2e2, #c9d6ff);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 10px; /* tighter for mobile */
}

body.dark-mode {
    background: linear-gradient(90deg, #181717, #202020);
}

.page-background {
    width: 100%;
    padding: 15px; /* reduced vertical spacing */
    display: flex;
    justify-content: center;
}

/* Responsive App Container */
.app-card {
    background: linear-gradient(90deg, #d7f5ff, #ffffff);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 30px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(16, 139, 211, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dark-mode .app-card {
    background: linear-gradient(to top, #0f0c29, #302b63, #24243e);
    box-shadow: 0 0 100px rgba(64, 0, 117, 0.755);
}

@media (min-width: 1100px) {
    .head {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 30px;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        position: relative;

        gap: 16px;
        flex-wrap: wrap;
    }
}

.head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 30px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    position: relative;

    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 40px; /* or 50px for larger */
    height: auto;
    object-fit: contain;
    padding-bottom: 0px;
}

.logo span {
    font-size: 20px;
    font-weight: 600;
    color: #003057; /* Slightly darker blue */
}

.dark-mode .logo span {
    color: #ffffffd3;
}

.search-container {
    flex: 1;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    background: #f0f6ff;
    border-radius: 25px;
    padding: 10px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.search-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.search-container i {
    font-size: 18px;
    color: #7a7a7a;
    margin-right: 10px;
}

.search-container input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    width: 100%;
    color: #1f1f1f;
}

.user-icon i {
    font-size: 22px;
    color: #003057;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.user-icon i:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(240, 248, 255, 0.8);
    border-radius: 15px;
    padding: 10px 18px;
    width: 70%;
    box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.search-bar i {
    font-size: 18px;
    color: #7a7a7a;
    margin-right: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #1f1f1f;
    width: 100%;
}

.profile-group {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 3; /* Same as profile-icon used to be */
}

.profile-icon i {
    font-size: 22px;
    color: #003057;
    padding: 10px;
    border-radius: 50%;
    background-color: rgba(240, 248, 255, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease;
}

.profile-icon i:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .profile-icon i {
    color: #003057;
    background-color: rgba(240, 248, 255, 0.904);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.dark-mode .profile-icon i:hover {
    background-color: rgba(240, 248, 255, 0.568);
}

.mode-btn {
    border: none;
    background: white;
    padding: 2px;
    border-radius: 50%;
}

.bulb i {
    font-size: 22px;
    color: #003057;
    padding: 10px;
    border-radius: 50%;
    background-color: rgba(240, 248, 255, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease;
}

.bulb i:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .bulb i:hover {
    background-color: rgba(0, 0, 0, 0.24);
    padding: 10px;
}

/* Stock Summary (Auto-scroll) */
.stock-summary {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow: 0px 1px 5px rgba(7, 172, 255, 0.36);
    display: flex;
    overflow-x: auto;
    gap: 30px;
    scrollbar-width: none;
    align-items: center;
}

.dark-mode .stock-summary {
    background: rgb(255, 255, 255);
    box-shadow: 0 0 100px rgba(64, 0, 117, 0.25);
}

.stock-summary::-webkit-scrollbar {
    display: none;
}

.stock-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 500;
}

.stock-symbol {
    font-weight: 600;
    color: #003057;
    font-size: 14px;
    margin-bottom: 2px;
}

.stock-price {
    font-size: 13px;
    color: #666;
}

.stock-change {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

.stock-change.green {
    color: #28a745;
}

.stock-change.red {
    color: #dc3545;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

/* Main Cards */
.main-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    flex-wrap: wrap;
    align-items: stretch;
    perspective: 1000px;
}

.main-card {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    gap: 12px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    box-shadow: 0px 1px 5px rgba(7, 172, 255, 0.36);
    box-sizing: border-box;
    min-width: 220px;

    transition: transform 0.2s ease;
    transform-style: preserve-3d;
}

.dark-mode .main-card {
    background: rgb(255, 255, 255);
    box-shadow: 0 0 100px rgba(64, 0, 117, 0.25);
}

.main-card-header {
    padding-left: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-logo {
    width: 40px;
    height: auto;
}

.main-logo-change {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 60px;
    padding-left: 40px;
}

.main-logo-change img {
    width: 40px;
    height: auto;
    object-fit: contain;
}

.main-logo-change .main-change {
    font-weight: 600;
    font-size: 16px;
}

.main-text h3 {
    margin: 0;
    font-size: 18px;
    color: #003057;
}

.subtitle {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.main-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.main-card-body canvas {
    width: 60px; /* previously too large */
    height: 80px;
}

.main-change {
    font-weight: 600;
    font-size: 16px;
    flex: 0 0 auto;
}

.main-graph-container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.main-graph-container canvas {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    padding-right: 8px;
    width: 140px;
    height: 40px;
    max-width: 100%;
}

.mini-graph {
    width: 80px;
    height: 30px;
    object-fit: contain;
    opacity: 0.7;
}

.main-card img {
    width: 60px;
    margin-bottom: 10px;
}

.main-card h3 {
    font-size: 20px;
}

.main-card .percentage {
    font-size: 20px;
    font-weight: 600;
    color: green;
    margin: 10px 0;
}

.main-card,
.insights,
.small-stock-card {
    padding: 20px; /* reduced from 25px or 30px */
    border-radius: 18px;
}

.details-btn {
    padding: 10px 20px;
    background-color: #4da1ff;
    box-shadow: 1px 2px 10px rgba(7, 172, 255, 0.66);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dark-mode .details-btn {
    background-color: #3b3678;
    box-shadow: 0 0 100px rgba(64, 0, 117, 0.834);
}

.details-btn:hover {
    background-color: #0f7fff;
}

.dark-mode .details-btn:hover {
    background-color: #27234b;
}

/* Insights */
.insights {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 1px 2px 10px rgba(7, 172, 255, 0.36);
    width: 200px;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dark-mode .insights {
    background: rgb(255, 255, 255);
    box-shadow: 0 0 100px rgba(64, 0, 117, 0.65);
}

.insights h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #003057;
}

.insight-container.loading {
    height: 200px;
    overflow: hidden;
    transition: height 0.3s ease;
}

.insight-container.loaded {
    height: auto;
}

.insights ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.insights li {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

.insights li span:first-child {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #001e3c;
}

.insights li span:nth-child(2) {
    font-size: 13px;
    color: #666;
}

.insight-top {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #001e3c;
}

.insight-company {
    font-size: 13px;
    color: #666;
}

.green {
    color: #28a745 !important;
}

.red {
    color: #dc3545 !important;
}

/* All Stocks */
.all-stocks-section {
    margin-top: 10px;
}

.all-stocks {
    display: flex;
    flex-direction: row;
    gap: 16px;
    min-width: max-content;
}

.all-stocks-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    scrollbar-width: none;
}

.all-stocks-scroll::-webkit-scrollbar {
    display: none;
}

.small-stock-card {
    width: 160px;
    flex-shrink: 0;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 16px;
    text-align: left;
    box-shadow: 1px 2px 10px rgba(7, 172, 255, 0.36);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.small-stock-card-link {
    text-decoration: none;
    color: inherit;
}

.small-stock-card:hover {
    transform: scale(1.02);
}

.dark-mode .small-stock-card {
    background: rgb(255, 255, 255);
    box-shadow: 0 0 100px rgba(64, 0, 117, 0.15);
}

.stock-card-header {
    font-weight: 600;
    color: #003057;
}

.stock-card-header strong {
    font-size: 16px;
    color: #003057;
}

.stock-card-header p {
    margin: 0;
    font-size: 13px;
    color: #555;
}

.stock-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.stock-card-footer canvas {
    width: 50px;
    height: 20px;
    opacity: 0.7;
}

.stock-card-footer img {
    width: 40px;
    height: 20px;
    opacity: 0.6;
}

.stock-card-footer span {
    font-weight: 600;
    font-size: 14px;
}

/* Shimmer loading base */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #e0e0e0;
    border-radius: 8px;
}
.dark-mode .skeleton {
    background: #3a3a3a;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Specific Skeleton Types */
.skeleton-stock-item {
    min-width: 80px;
    height: 50px;
    margin-right: 20px;
    border-radius: 12px;
}

.skeleton-main-card {
    height: 220px;
    flex: 1 1 220px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.skeleton-insight {
    height: 50px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 12px;
}

.skeleton-small-card {
    height: 120px;
    width: 160px;
    border-radius: 16px;
    margin-right: 16px;
}

@media (max-width: 768px) {
    .app-card {
        padding: 16px;
    }

    .head {
        display: flex;
        flex-wrap: nowrap; /* Prevent wrapping */
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .profile-group {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .bulb {
        display: none;
    }

    .main-content {
        flex-direction: column;
    }

    .insights {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .main-cards {
        flex-direction: column;
    }

    .main-card {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.9);
    }

    .logo {
        order: 1;
        flex: 0 1 auto;
        display: flex;
        align-items: center;
    }

    .logo img {
        width: 30px;
    }

    .logo span {
        font-size: 16px;
    }

    .profile-icon {
        order: 3;
    }

    .search-bar {
        order: 2;
        width: 100%;
    }

    .search-bar input {
        font-size: 14px;
        padding: 8px;
    }

    .mode-btn {
        order: 4;
        margin-left: 8px;
    }

    .bulb {
        display: block; /* Unhide the bulb in mobile */
        order: 4; /* Place after profile-icon */
        margin-left: 8px;
    }

    .mode-btn {
        order: 4; /* Also ensure button follows proper order */
        background: transparent;
    }

    .left-panel {
        overflow: hidden;
        flex: 1;
        min-width: 0;
        width: 100%;
    }

    .stock-summary {
        gap: 20px;
        padding: 12px 20px;
    }

    .all-stocks-scroll {
        padding: 8px 0;
    }

    .small-stock-card {
        width: 140px;
        height: 110px;
    }

    #mobile-search-bar {
        transition: all 0.3s ease;
    }

    #mobile-search-bar.collapsed {
        width: 44px;
        padding: 10px;
        justify-content: center;
    }

    #mobile-search-bar.collapsed input {
        display: none;
    }

    #mobile-search-bar.expanded {
        width: 100%;
        padding: 10px 18px;
        justify-content: flex-start;
    }

    #mobile-search-bar.expanded input {
        display: inline;
    }
}

@media screen and (max-width: 370px) {
    .header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .header-left {
        justify-content: center;
        width: 100%;
    }

    .header-right {
        justify-content: center;
        gap: 0.5rem;
        padding-right: 0.5rem; /* Add this */
    }

    .header-right button {
        padding: 0.4rem;
        transform: translateX(-4px);
    }

    .mode-btn {
        padding: 0.4rem;
        transform: translateX(-16px);
    }

    .header-logo {
        font-size: 1rem;
    }

    .header img {
        width: 20px;
        height: 20px;
    }
}
