/**
 * DS Udžbenici — Frontend CSS
 */

/* ── Layout ─────────────────────────────────────────── */
.ds-archive-wrap,
.ds-single-wrap,
.ds-account-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ds-page-title {
    margin-bottom: 24px;
    font-size: 1.8em;
}

/* ── Filteri ────────────────────────────────────────── */
.ds-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 6px;
}

.ds-filter,
.ds-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ds-search-input {
    flex: 1;
    min-width: 200px;
}

/* ── Grid (katalog) ─────────────────────────────────── */
.ds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.ds-komplet-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.ds-komplet-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ds-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.ds-card-body {
    padding: 16px;
}

.ds-card-title {
    margin: 0 0 8px;
    font-size: 1.1em;
}

.ds-card-title a {
    color: inherit;
    text-decoration: none;
}

.ds-card-title a:hover {
    color: #0073aa;
}

.ds-card-excerpt {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 12px;
}

.ds-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ds-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8em;
    border-radius: 3px;
    background: #eef3f7;
    color: #333;
}

.ds-tag--predmet { background: #e3f2fd; }
.ds-tag--razred  { background: #f3e5f5; }

/* ── Dugmad ─────────────────────────────────────────── */
.ds-btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.2s;
}

.ds-btn-primary {
    background: #0073aa;
    color: #fff;
}

.ds-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.ds-btn-buy {
    background: #28a745;
    color: #fff;
}

.ds-btn-buy:hover {
    background: #1e7e34;
    color: #fff;
}

.ds-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Single komplet ─────────────────────────────────── */
.ds-single-header {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.ds-single-thumb {
    flex: 0 0 300px;
}

.ds-single-thumb img {
    width: 100%;
    border-radius: 6px;
}

.ds-single-meta {
    flex: 1;
}

.ds-single-title {
    margin: 0 0 16px;
}

.ds-meta-item {
    margin-bottom: 4px;
    font-size: 14px;
}

/* ── Elementi ───────────────────────────────────────── */
.ds-elements {
    margin-top: 32px;
}

.ds-elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.ds-element-card {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 16px;
    background: #fff;
}

.ds-element--locked {
    opacity: 0.85;
    background: #fafafa;
}

.ds-element-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ds-element-title {
    margin: 0 0 6px;
    font-size: 1em;
}

.ds-element-desc {
    color: #666;
    font-size: 0.85em;
    margin: 0 0 10px;
}

.ds-element-locked-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 0.85em;
    color: #856404;
}

.ds-lock-icon {
    font-size: 1.2em;
}

/* ── Moj nalog ──────────────────────────────────────── */
.ds-code-form-wrap {
    background: #f0f6fc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.ds-code-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ds-code-input {
    padding: 10px 14px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    width: 240px;
}

.ds-code-input:focus {
    border-color: #0073aa;
    outline: none;
}

.ds-code-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
}

.ds-code-message--success {
    background: #d4edda;
    color: #155724;
}

.ds-code-message--error {
    background: #f8d7da;
    color: #721c24;
}

.ds-grants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ds-grant-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    align-items: center;
}

.ds-grant--active {
    border-left: 4px solid #28a745;
}

.ds-grant--expired {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.ds-grant-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.ds-grant-info h3 {
    margin: 0 0 4px;
    font-size: 1.1em;
}

.ds-grant-info h3 a {
    color: inherit;
    text-decoration: none;
}

.ds-grant-expiry {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 8px;
}

.ds-empty {
    color: #888;
    font-style: italic;
}

/* ── Dokumenti ──────────────────────────────────────── */
.ds-doc-list {
    list-style: none;
    padding: 0;
}

.ds-doc-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.ds-doc-list a {
    text-decoration: none;
    color: #0073aa;
}

/* ── Paginacija ─────────────────────────────────────── */
.ds-pagination {
    margin-top: 32px;
    text-align: center;
}

/* ── Login required ─────────────────────────────────── */
.ds-login-required {
    text-align: center;
    padding: 40px 20px;
}

/* ── No results ─────────────────────────────────────── */
.ds-no-results {
    text-align: center;
    padding: 40px;
    color: #888;
    grid-column: 1 / -1;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .ds-single-header {
        flex-direction: column;
    }
    .ds-single-thumb {
        flex: none;
    }
    .ds-code-form {
        flex-direction: column;
    }
    .ds-code-input {
        width: 100%;
    }
    .ds-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
