/* File: /style.css */

/* --- Basic Setup --- */
:root {
    --bg-color: #1a120b;
    --text-color: #f0e6d2;
    --accent-color: #ffb800;
    --card-bg: rgba(40, 30, 20, 0.5);
    --card-border: rgba(255, 184, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px 40px;
    
    /* --- Sticky Footer Fix --- */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 100% viewport height */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%; /* Added for flex */
    
    /* --- Sticky Footer Fix --- */
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

h1, h2 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 10px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* --- Back Link --- */
.back-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 25px;
    transition: opacity 0.2s;
}
.back-link:hover {
    opacity: 0.8;
}

/* --- Directory List Style --- */
.directory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    
    /* --- Sticky Footer Fix --- */
    flex-grow: 1; /* List ko push karega */
}

.directory-list li {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 20px;
    display: flex;
    align-items: center; /* Vertically center align */
    justify-content: space-between; /* Content aur buttons ko alag karega */
    flex-wrap: wrap; /* Chhoti screen par wrap karega */
    transition: all 0.2s ease-out;
}

.directory-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 184, 0, 0.6);
}

/* --- Category Page Link (Main index.html) --- */
/* Jab poora list item link ho (category page par) */
.directory-list a.list-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    flex-grow: 1;
    width: 100%; /* Added for consistency */
}

.directory-list a.list-link:hover {
    opacity: 0.9;
}


/* --- List Item Image --- */
.item-icon {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
    border: 1px solid var(--card-border);
    background-color: #111;
    flex-shrink: 0; /* Image ko shrink hone se roko */
}

/* --- List Item Text --- */
.item-details {
    flex-grow: 1; /* Beech ki poori jagah le lega */
}
.item-details h3 {
    font-size: 1.5rem;
    margin: 0;
    color: #fff;
    font-weight: 600;
}
.item-details p {
    font-size: 1rem;
    opacity: 0.7;
    margin: 5px 0 0 0;
}

/* --- Action Buttons (Preview/Buy) --- */
.item-actions {
    display: flex;
    gap: 10px;
    margin-left: 20px; /* Text se thoda gap */
    flex-shrink: 0; /* Buttons ko shrink hone se roko */
}

/* Button Common Style */
.preview-button,
.buy-button {
    text-decoration: none;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
    white-space: nowrap; /* Button text ko wrap hone se roko */
}

/* Preview Button Style */
.preview-button {
    background: none;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}
.preview-button:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* Buy Button Style */
.buy-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: 1px solid var(--accent-color);
}
.buy-button:hover {
    background-color: #ffca40;
    border-color: #ffca40;
}


/* --- Simple Footer --- */
.site-footer {
    text-align: center;
    margin-top: 50px;
    opacity: 0.6;
}

/*
=================================
--- Responsive Media Query ---
=================================
*/
@media (max-width: 600px) {
    body {
        padding: 15px; /* Mobile par padding kam karo */
    }

    h1, h2 {
        font-size: 1.8rem;
    }

    /* Common list item style */
    .directory-list li {
        flex-direction: column; /* Stack items vertically */
        align-items: flex-start; /* Align left */
        padding: 15px;
    }
    
    /* === FIX FOR ROOT PAGE (index.html) === */
    .directory-list a.list-link {
        flex-direction: column; /* Stack icon and text vertically */
        width: 100%;
    }

    /* Common icon style for mobile */
    .item-icon {
        width: 100%;
        height: 150px; /* Mobile par badi image */
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    /* Common details style for mobile */
    .item-details {
        margin-bottom: 20px; 
        width: 100%; /* Ensure it takes full width */
    }
    
    /* === FIX FOR CATEGORY PAGE (product list) === */
    .item-actions {
        width: 100%;
        margin-left: 0;
    }
    
    .preview-button,
    .buy-button {
        flex-grow: 1; /* Buttons ko barabar width do */
    }
}
