/* ============================================
   TheDataprysm Store - Design System
   Clean, Flat, Professional UI
   ============================================ */

:root {
    /* Solid Colors - NO GRADIENTS */
    --primary-blue: #1A73E8;
    --deep-blue: #004AAD;
    --background-white: #FFFFFF;
    --background-light: #F5F5F5;
    --border-color: #E5E5E5;
    --text-dark: #1C1C1C;
    --text-light: #3A3A3A;
    --text-muted: #666666;
    --success: #34A853;
    --danger: #EA4335;

    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 16px;
    --line-height: 1.6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-dark);
    background-color: var(--background-light);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

/* Responsive Typography */
h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
}

h5 {
    font-size: clamp(1rem, 2vw, 1.1rem);
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--deep-blue);
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    overflow-x: hidden;
}

.container-wide {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    overflow-x: hidden;
}

section {
    padding: clamp(30px, 8vw, 60px) 0;
}

/* Global Image Responsiveness */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe,
video {
    max-width: 100%;
    height: auto;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
    background-color: var(--background-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-menu a {
    color: var(--text-light);
    font-weight: 500;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-blue);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background-color: var(--primary-blue);
    color: white;
    padding: clamp(40px, 10vw, 80px) 0;
    text-align: center;
    overflow-x: hidden;
}

.hero h1 {
    font-size: clamp(1.75rem, 6vw, 3rem);
    margin-bottom: 1rem;
    padding: 0 16px;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    padding: 0 16px;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.search-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.search-bar {
    display: flex;
    background-color: white;
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
}

.search-bar input {
    flex: 1;
    min-width: 0;
    padding: clamp(10px, 3vw, 14px) clamp(12px, 3vw, 20px);
    border: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    outline: none;
}

.search-bar button {
    padding: clamp(10px, 3vw, 14px) clamp(16px, 4vw, 28px);
    background-color: var(--deep-blue);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-bar button:hover {
    background-color: #003080;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: clamp(10px, 2vw, 12px) clamp(16px, 4vw, 24px);
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--deep-blue);
    color: white;
}

.btn-secondary {
    background-color: var(--background-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #d33b2c;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #2d8e47;
}

/* ============================================
   CARDS & GRID
   ============================================ */

.section-title {
    text-align: center;
    margin-bottom: clamp(1.5rem, 5vw, 3rem);
    padding: 0 16px;
    word-wrap: break-word;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 2rem;
    width: 100%;
}

@media (min-width: 640px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 768px) {
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .app-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.app-card {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    padding: clamp(12px, 3vw, 20px);
    transition: border-color 0.2s;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.app-card:hover {
    border-color: var(--primary-blue);
}

.app-icon {
    width: 100%;
    max-width: 80px;
    height: auto;
    aspect-ratio: 1;
    background-color: var(--background-light);
    margin-bottom: 12px;
    object-fit: cover;
}

.app-card h3 {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    margin-bottom: 8px;
    word-wrap: break-word;
}

.app-card .category {
    color: var(--primary-blue);
    font-size: clamp(0.8rem, 2vw, 0.85rem);
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-word;
}

.app-card .version {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 2vw, 0.85rem);
    margin-bottom: 8px;
}

.app-card .downloads {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 2vw, 0.85rem);
}

/* ============================================
   APP DETAILS PAGE
   ============================================ */

.app-detail-container {
    background-color: var(--background-white);
    padding: clamp(20px, 5vw, 40px);
    margin-top: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .app-header {
        flex-direction: row;
        gap: 32px;
        margin-bottom: 3rem;
    }
}

.app-detail-icon {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1;
    background-color: var(--background-light);
    object-fit: cover;
    flex-shrink: 0;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .app-detail-icon {
        margin: 0;
    }
}

.app-info h1 {
    margin-bottom: 12px;
}

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0;
    color: var(--text-muted);
}

.app-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.download-btn {
    margin-top: 20px;
    padding: clamp(12px, 3vw, 14px) clamp(20px, 5vw, 32px);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    width: 100%;
}

@media (min-width: 768px) {
    .download-btn {
        width: auto;
    }
}

.app-description {
    margin-bottom: 3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.app-description p,
.app-description ul,
.app-description ol {
    max-width: 100%;
    overflow-wrap: break-word;
}

.screenshots-section h2 {
    margin-bottom: 1.5rem;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

@media (min-width: 640px) {
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.screenshot-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    display: block;
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    gap: 12px;
    width: 100%;
}

@media (min-width: 768px) {
    .filter-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background-color: white;
    font-size: clamp(0.9rem, 2vw, 1rem);
    cursor: pointer;
    width: 100%;
}

@media (min-width: 768px) {
    .filter-select {
        width: auto;
        min-width: 200px;
    }
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 16px);
    border: 1px solid var(--border-color);
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-family: var(--font-main);
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid var(--primary-blue);
    border-color: var(--primary-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input {
    width: auto;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--background-white);
    border-top: 1px solid var(--border-color);
    padding: clamp(20px, 5vw, 40px) 0 20px;
    margin-top: clamp(30px, 8vw, 60px);
    width: 100%;
    overflow-x: hidden;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }
}

.footer-section h4 {
    margin-bottom: 16px;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.footer-section p {
    font-size: clamp(0.85rem, 2vw, 1rem);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-light);
    font-size: clamp(0.85rem, 2vw, 1rem);
    word-break: break-word;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    word-break: break-word;
}

/* ============================================
   ADMIN PANEL
   ============================================ */

.admin-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 40px) 16px;
    overflow-x: hidden;
}

.admin-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

@media (min-width: 768px) {
    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 3rem;
    }
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 2rem;
}

.admin-nav button {
    padding: clamp(8px, 2vw, 10px) clamp(16px, 3vw, 20px);
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(0.85rem, 2vw, 1rem);
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-nav button.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.admin-section {
    background-color: var(--background-white);
    padding: clamp(16px, 4vw, 32px);
    margin-bottom: 2rem;
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    padding: clamp(8px, 2vw, 12px);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: clamp(0.85rem, 2vw, 1rem);
}

.admin-table th {
    font-weight: 600;
    background-color: var(--background-light);
}

.admin-table tr:hover {
    background-color: var(--background-light);
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-actions button {
    padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px);
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    margin: 2px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    .nav-menu {
        gap: 8px;
    }

    .nav-menu a {
        font-size: 0.85rem;
    }

    section {
        padding: 40px 0;
    }

    .btn {
        width: 100%;
        padding: 12px 16px;
    }

    .admin-actions {
        flex-direction: column;
    }

    .admin-actions button {
        width: 100%;
    }
}

@media (max-width: 360px) {

    .container,
    .container-wide {
        padding: 0 12px;
    }

    .logo {
        font-size: 0.95rem;
        gap: 6px;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   LOADING & MESSAGES
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.message {
    padding: 16px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.message-success {
    background-color: #e8f5e9;
    border-color: var(--success);
    color: #1b5e20;
}

.message-error {
    background-color: #ffebee;
    border-color: var(--danger);
    color: #b71c1c;
}

.message-info {
    background-color: #e3f2fd;
    border-color: var(--primary-blue);
    color: #0d47a1;
}