/* Unified Variables */
:root {
    --primary: #307dd5;
    --bg: #ffffff;
    --card: #ffffff;
    --text: #000000;
    --muted: #6b7280;
    --border: #000000;
    --border-width: 2px;
    --accent: #d63384;
    --mandatory: #dc2626;
    --recommended: #059669;
    --optional: #6b7280;
    --code-bg: #f3f4f6;
    --success: #10b981;
    --error: #ef4444;
}

/* Base Styles */
* { box-sizing: border-box; }

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 20px;
}

/* Layouts */
body.client-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.side-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Common Components */
h2 {
    font-size: 2rem;
    margin-top: 0;
    border-bottom: var(--border-width) solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
}

section {
    margin-bottom: 5rem;
}

.card {
    background: var(--card);
    border: var(--border-width) solid var(--border);
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

button {
    cursor: pointer;
    font-family: inherit;
    border-radius: 4px;
    border: none;
    transition: opacity 0.2s;
    font-size: 20px;
}

button:hover {
    opacity: 0.9;
}

button.primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

button.secondary {
    background: white;
    color: var(--text);
    border: var(--border-width) solid var(--border);
    padding: 0.5rem 1rem;
    font-size: 20px;
}

.side-layout nav p {
    font-size: 0.85rem;
    color: var(--muted);
}

.side-layout nav ul {
    list-style: none;
    padding: 0;
}
.side-layout nav li {
    margin-bottom: 0.5rem;
}
.side-layout nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    display: block;
    padding: 0.25rem 0;
}
.side-layout nav a:hover {
    color: var(--primary);
}

.search-container {
    gap: 0; 
    display: flex;
    flex: 1;
}

.search-container input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.search-container button.primary {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem;
    border: var(--border-width) solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 20px;
}

/* Badges */
.badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 800;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}
.badge-mandatory {
    background: #fee2e2;
    color: var(--mandatory);
}
.badge-recommended {
    background: #dcfce7;
    color: var(--recommended);
}
.badge-optional {
    background: #f3f4f6;
    color: var(--optional);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--card);
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 1rem;
    border: var(--border-width) solid var(--border);
}

th {
    background: var(--code-bg);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Code & Pre */
code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95em;
    color: var(--accent);
}

pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 1rem 0;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Client Specifics */
.client-layout .card {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
    position: relative;
}

header.client-header {
    background: var(--card);
    padding: 1rem 5%;
    border-bottom: var(--border-width) solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav.client-nav {
    background: var(--card);
    border-top: var(--border-width) solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.client-nav button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 800;
    gap: 5px;
}

.client-nav button.active { color: var(--primary); }
.client-nav button i { font-size: 1.2rem; }

main.client-main {
    flex: 1;
    padding: 2rem 5% 5rem 5%;
    overflow-y: auto;
}

.screen { display: none; }
.screen.active { display: block; }

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--border);
    object-fit: cover;
}

.fav-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--border);
    padding: 0;
    line-height: 1;
}

.fav-btn.active { color: #f59e0b; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.75rem;
    border-top: var(--border-width) solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.feed-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: var(--border-width) solid var(--border);
}

.delete-btn { color: #ef4444; cursor: pointer; border: none; background: none; }

#apps-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.app-grid-card {
    background: var(--card);
    border: var(--border-width) solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 200px;
}

.app-grid-card h3 {
    margin-top: 1rem;
    font-size: 1.1rem;
}

.app-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#feed-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Details Screen Styles */
.details-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    padding-bottom: 2rem;
    border-bottom: var(--border-width) solid var(--border);
}

.app-icon.large {
    width: 120px;
    height: 120px;
    border-radius: 24px;
}

.header-text h2 {
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

.app-details h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.app-launcher {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-launcher h3 {
    margin-top: 1rem;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.detail-item {
    background: #f9fafb;
    padding: 1rem;
    border: var(--border-width) solid var(--border);
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.detail-item div {
    font-size: 0.9rem;
    word-break: break-word;
}

.screenshot-gallery {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.gallery-img {
    height: 300px;
    border: var(--border-width) solid var(--border);
    border-radius: 8px;
    object-fit: contain;
}

.details-image {
    max-width: 100%;
    border: var(--border-width) solid var(--border);
    border-radius: 8px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Updated Card Actions */
.card-actions-top {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.info-btn, .info-btn-top {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary);
    padding: 0;
    line-height: 1;
}

.info-btn-top {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.button-link {
    text-decoration: none;
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.button-link-small {
    text-decoration: none;
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 800;
}

.card-footer {
    margin-top: 1rem;
}

.app-desc-short {
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Side Layout Specifics (Generator/Validator) */
.side-layout nav.side-nav {
    width: 300px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--card);
    border-right: var(--border-width) solid var(--border);
    padding: 2rem;
    flex-shrink: 0;
    overflow-y: auto;
}


h1 img{
    width:56px; 
    height: 56px;
    display: block;
}

.side-layout main {
    flex: 1;
    padding: 3rem 5%;
    min-width: 0;
}

/* Generator Specifics */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }

.side-layout label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--muted);
}

.required::after { content: " *"; color: var(--mandatory); }

.app-entry {
    border: var(--border-width) solid var(--border);
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    background: #fcfcfc;
    position: relative;
}

.add-field-area {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Validator Specifics */
.drop-zone {
    border: var(--border-width) dashed var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}

.drop-zone.dragover { border-color: var(--primary); background: #eff6ff; }

#results { margin-top: 2rem; }

.report-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 4px solid transparent;
}

.report-error { background: #fef2f2; border-left-color: var(--error); color: #991b1b; }
.report-warning { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }
.report-success { background: #f0fdf4; border-left-color: var(--success); color: #166534; }

textarea {
    height: 200px;
    font-family: monospace;
    margin-bottom: 1rem;
}

/* Structural Layout */
.body {
    width: 900px;
    margin: 0 auto;
}

.col-md-3 {
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 992px) {
    .col-md-3 {
        float: left;
        width: 25%;
    }
}

.spacer{clear:both}

/* Main Footer Container */
.footer { 
    margin-top: 20px;
    background: #202428; 
    padding: 40px 0 10px 0; 
    border-top: 2px solid var(--primary); 
    clear: both;
    flex: 0 0 100%;
    width: 100%;    
    position: relative;
    z-index: 20;    
}

.footer ul {
    list-style-type: none; 
    width: 300px; 
    margin: 0 auto;
    padding: 0;
}

.footer ul li {
    margin-bottom: 20px; 
    height: 40px; 
}

.footer ul img {
    border-radius: 22%; 
    width: 40px; 
    height: 40px; 
    float: left;
}

.footer a {
    color: #CFCFCF;
}

.footer ul a {
    color: #CFCFCF; 
    font-size: 24px; 
    margin-left: 10px;
    display: inline-block;  
    line-height: 40px;
    vertical-align: middle;
    text-decoration: none;
}

.footer p {
    color: #B0B0B0;
    font-size: 20px;
    line-height: 1.6;
    padding-bottom: 10px;
}

.text-center {
    display: flex;
    align-items: center;   
    justify-content: center; 
    gap: 10px; 
}

/* Tabs Component */
.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.tab-btn {
    background: white;
    border: var(--border-width) solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    font-size: 20px;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Enhanced Input Groups for Generator */
.input-group-combined {
    display: flex;
    gap: 0;
    width: 100%;
    align-items: stretch;
}

.input-group-combined input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1;
    margin: 0;
}

.icon-btn-trash {
    background: #fee2e2;
    color: var(--mandatory);
    border: var(--border-width) solid var(--border);
    border-radius: 4px;
    padding: 0.8rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 0.2s;
    margin: 0;
}

.input-group-combined .icon-btn-trash {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.icon-btn-trash:hover {
    background: #fecaca;
}
