/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
    background-color: #facc15;
    padding: 3rem 1rem 6rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-bg-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.decor-circle-1 {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background-color: #fde047;
    opacity: 0.5;
    filter: blur(3rem);
}

.decor-circle-2 {
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    background-color: #eab308;
    opacity: 0.3;
    filter: blur(3rem);
}

.hero-content {
    max-width: 64rem;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo-icon {
    background-color: #0f172a;
    padding: 0.625rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: rotate(-6deg);
}

.logo-icon i {
    font-size: 2rem;
    color: #facc15;
}

.logo-text {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    color: #0f172a;
}

.logo-highlight {
    color: #ffffff;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    text-align: center;
    color: #1e293b;
    font-size: 1.125rem;
    margin-bottom: 2rem;
    font-weight: 500;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* ===== SEARCH FORM ===== */
.search-form {
    max-width: 42rem;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    inset-y: 0;
    left: 0;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.search-icon i {
    color: #94a3b8;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.search-wrapper:focus-within .search-icon i {
    color: #ca8a04;
}

.search-input {
    display: block;
    width: 100%;
    padding: 1rem 8rem 1rem 3.5rem;
    background-color: #ffffff;
    border: 4px solid transparent;
    border-radius: 9999px;
    font-size: 1.125rem;
    font-weight: 500;
    outline: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    color: #1e293b;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    border-color: #fde047;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(250, 204, 21, 0.3);
}

.search-button {
    position: absolute;
    inset-y: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    background-color: #0f172a;
    color: #facc15;
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.search-button:hover {
    background-color: #1e293b;
}

.search-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
    margin-top: -2.5rem;
    position: relative;
    z-index: 20;
    padding-bottom: 4rem;
}

/* ===== NOTIFICATION ===== */
.notification {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid;
}

.notification-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.notification-demo {
    background-color: #fefce8;
    border-color: #fde68a;
    color: #854d0e;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notification-content i {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.notification-title {
    font-weight: 600;
}

.notification-message {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===== LOADING STATE ===== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.spinner-container {
    position: relative;
}

.spinner-ring {
    width: 4rem;
    height: 4rem;
    border: 4px solid #f1f5f9;
    border-radius: 50%;
}

.spinner-ring-active {
    width: 4rem;
    height: 4rem;
    border: 4px solid #facc15;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 0;
    left: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: #64748b;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== RESULTS ===== */
.results-container {
    display: block;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-title i {
    color: #eab308;
}

.result-count {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    background-color: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== APP CARD ===== */
.app-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #facc15;
}

.app-card-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 1rem;
    overflow: hidden;
    background-color: #f1f5f9;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.3s;
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.app-icon-placeholder i {
    font-size: 2rem;
}

.app-info {
    flex: 1;
    overflow: hidden;
}

.app-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.app-card:hover .app-title {
    color: #ca8a04;
}

.app-developer {
    font-size: 0.875rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.app-rating {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    background-color: #fef9c3;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

.app-rating i {
    color: #eab308;
    margin-right: 0.25rem;
}

.app-size {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

.app-card-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-verified {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #16a34a;
    font-size: 0.75rem;
    font-weight: 500;
}

.app-verified i {
    font-size: 1rem;
}

.app-download-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background-color: #0f172a;
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1);
}

.app-download-btn:hover {
    background-color: #facc15;
    color: #0f172a;
    text-decoration: none;
}

.app-download-btn i {
    font-size: 1rem;
}