/* ========================================================================
   Assets Manager Pro - Frontend Core
   Consolidated baseline frontend styles
   Package 3
   ======================================================================== */

/* ========================================================================
   PHASE 6A - PRIORITY 5 LAYER CONTRACT
   Owns only:
   - frontend container/base typography
   - page-neutral grid foundations and responsive shell behavior
   - low-level status and layout primitives required by multiple screens
   Reusable cards, notices, buttons, filters, and tables belong in
   frontend-components.css.
   ======================================================================== */

/**
 * Assets Manager Pro - Frontend Styles
 * Version: 3.0 - Fully Variable-Driven
 */

/* Import variables */

/* ============================================
   BASE STYLES
   ============================================ */

.amp-frontend-container {
    font-family: var(--amp-font-family);
    font-size: var(--amp-text-base);
    background-color: var(--amp-bg-body);
    color: var(--amp-text-primary);
    line-height: var(--amp-leading-relaxed);
}

/* ============================================
   ASSETS GRID LAYOUT
   ============================================ */

.amp-assets-grid {
    display: grid;
    gap: var(--amp-space-6);
    margin: var(--amp-space-6) 0;
}

.amp-assets-grid.amp-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.amp-assets-grid.amp-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.amp-assets-grid.amp-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* ============================================
   ASSET CARD
   ============================================ */


.amp-asset-status {
    display: inline-flex;
    padding: var(--amp-space-1) var(--amp-space-3);
    font-size: var(--amp-text-xs);
    font-weight: var(--amp-font-semibold);
    border-radius: var(--amp-radius-full);
    text-transform: uppercase;
    line-height: 1;
}

.amp-asset-status.amp-status-active {
    background: var(--amp-success-light);
    color: var(--amp-success);
}

.amp-asset-status.amp-status-inactive {
    background: var(--amp-gray-200);
    color: var(--amp-gray-700);
}

.amp-asset-status.amp-status-under_maintenance {
    background: var(--amp-warning-light);
    color: var(--amp-warning-hover);
}

.amp-asset-status.amp-status-disposed {
    background: var(--amp-error-light);
    color: var(--amp-error);
}

.amp-asset-qr img {
    width: 60px;
    height: 60px;
    border-radius: var(--amp-radius-sm);
    border: 1px solid var(--amp-border-light);
}

.amp-asset-actions {
    margin-top: auto;
}

/* ============================================
   BUTTONS
   ============================================ */

.amp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--amp-space-2);
    padding: var(--amp-btn-padding-y) var(--amp-btn-padding-x);
    font-size: var(--amp-text-base);
    font-weight: var(--amp-font-medium);
    border: 1px solid transparent;
    border-radius: var(--amp-radius-md);
    transition: var(--amp-transition-base);
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    color: var(--amp-white);
    text-align: center;
}

.amp-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--amp-shadow-md);
    color: var(--amp-white);
}


/* ============================================
   ASSET DETAIL PAGE
   ============================================ */

.amp-asset-detail {
    max-width: 1000px;
    margin: var(--amp-space-8) auto;
    background: var(--amp-bg-card);
    border-radius: var(--amp-radius-xl);
    box-shadow: var(--amp-shadow-md);
    overflow: hidden;
}

.amp-asset-detail-header {
    padding: var(--amp-space-6);
    background: var(--amp-bg-light);
    border-bottom: 1px solid var(--amp-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--amp-space-4);
}

.amp-asset-detail-header h2 {
    margin: 0;
    font-size: var(--amp-text-3xl);
    color: var(--amp-text-primary);
    line-height: 1.2;
}

.amp-asset-detail-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    background: var(--amp-gray-100);
}

.amp-asset-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amp-asset-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--amp-space-6);
    padding: var(--amp-space-6);
}

.amp-asset-detail-section {
    margin-bottom: var(--amp-space-6);
}

.amp-asset-detail-section h3 {
    margin: 0 0 var(--amp-space-4) 0;
    font-size: var(--amp-text-xl);
    color: var(--amp-text-primary);
    font-weight: var(--amp-font-semibold);
    border-bottom: 2px solid var(--amp-primary);
    padding-bottom: var(--amp-space-2);
}

.amp-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.amp-detail-table tr:not(:last-child) {
    border-bottom: 1px solid var(--amp-border-light);
}

.amp-detail-table th {
    padding: var(--amp-space-3);
    text-align: left;
    font-weight: var(--amp-font-semibold);
    color: var(--amp-text-secondary);
    width: 40%;
    vertical-align: top;
}

.amp-detail-table td {
    padding: var(--amp-space-3);
    color: var(--amp-text-primary);
    vertical-align: top;
}

/* ============================================
   SEARCH FORM
   ============================================ */


.amp-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%23616161' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--amp-space-3) center;
    background-size: 12px;
    padding-right: var(--amp-space-8);
}

.amp-search-actions {
    display: flex;
    gap: var(--amp-space-3);
    align-items: center;
}

/* ============================================
   PAGINATION
   ============================================ */

.amp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--amp-space-2);
    margin: var(--amp-space-8) 0;
    flex-wrap: wrap;
}

.amp-pagination a,
.amp-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--amp-space-3);
    border: 1px solid var(--amp-border-light);
    border-radius: var(--amp-radius-md);
    text-decoration: none;
    color: var(--amp-text-primary);
    font-weight: var(--amp-font-medium);
    transition: var(--amp-transition-base);
}

.amp-pagination a:hover {
    background: var(--amp-primary-light);
    border-color: var(--amp-primary);
    color: var(--amp-primary);
}

.amp-pagination .current {
    background: var(--amp-primary);
    color: var(--amp-white);
    border-color: var(--amp-primary);
}

.amp-pagination .dots {
    border: none;
    color: var(--amp-text-tertiary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .amp-assets-grid.amp-columns-2,
    .amp-assets-grid.amp-columns-3,
    .amp-assets-grid.amp-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .amp-search-grid {
        grid-template-columns: 1fr;
    }
    
    .amp-asset-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .amp-stats-widget {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .amp-asset-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--amp-space-3);
    }
    
    .amp-detail-table th,
    .amp-detail-table td {
        display: block;
        width: 100%;
        padding: var(--amp-space-2) 0;
    }
    
    .amp-detail-table tr {
        display: flex;
        flex-direction: column;
        padding: var(--amp-space-3) 0;
        border-bottom: 1px solid var(--amp-border-light);
    }
    
    .amp-detail-table tr:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .amp-stats-widget {
        grid-template-columns: 1fr;
    }
    
    .amp-search-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .amp-search-actions .amp-btn {
        width: 100%;
    }
    
    .amp-pagination {
        gap: var(--amp-space-1);
    }
    
    .amp-pagination a,
    .amp-pagination span {
        min-width: 36px;
        height: 36px;
        font-size: var(--amp-text-sm);
    }
}
/* ========================================================================
   PACKAGE 5 - FOCUS VISIBILITY
   ======================================================================== */

.amp-form-control:focus-visible,
.amp-filter-item input[type="text"]:focus-visible,
.amp-filter-item select:focus-visible,
input[type="text"].amp-form-control:focus-visible,
input[type="email"].amp-form-control:focus-visible,
input[type="number"].amp-form-control:focus-visible,
select.amp-form-control:focus-visible,
textarea.amp-form-control:focus-visible {
    outline: 2px solid var(--amp-primary);
    outline-offset: 1px;
    box-shadow: var(--amp-focus-ring-shadow);
}
