/* App Store Dark Theme */
:root {
    --bg-color: #000000;
    --card-bg: #1C1C1E;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --accent-blue: #0A84FF;
    --accent-gold: #FFD60A;
    --divider: #38383A;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

/* Header / Navigation */
header {
    background: rgba(28, 28, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--divider);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 17px;
}

/* Hero Section */
.hero {
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 30px;
}

h2.section-title {
    font-size: 34px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

/* Search Bar */
.search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    background-color: var(--card-bg);
    border: none;
    padding: 12px 40px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 17px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background-color: #2C2C2E;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 18px;
    height: 18px;
}

/* App List */
.app-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* List style with dividers */
}

.app-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--divider);
    transition: background-color 0.2s;
}

.app-item:last-child {
    border-bottom: none;
}

.app-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 15px;
}

.app-info {
    flex: 1;
    min-width: 0;
    /* Flex truncate fix */
}

.app-name {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.get-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 20px;
    border-radius: 20px;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    min-width: 70px;
    text-align: center;
}

.get-btn:hover {
    background-color: rgba(10, 132, 255, 0.2);
}

.delete-btn {
    color: #FF453A;
    background: none;
    border: none;
    font-size: 14px;
    margin-left: 10px;
    cursor: pointer;
}

/* Admin Form */
.admin-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background-color: black;
    border: 1px solid var(--divider);
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:active {
    opacity: 0.8;
}

/* Status Message */
#statusMsg {
    margin-top: 15px;
    text-align: center;
    font-size: 15px;
}

.text-gold {
    color: var(--accent-gold);
}

.text-danger {
    color: #FF453A;
}

/* Responsive Grid for Desktop */
@media (min-width: 768px) {
    .app-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        border-bottom: none;
    }

    .app-item {
        border-bottom: none;
        background-color: var(--card-bg);
        border-radius: 14px;
        padding: 15px;
    }
}