.templates-container{
    margin: 15px 40px;
}

.header-container{
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    border-bottom: 1px solid #333333;
    padding: 10px;
}

.templates-title{
    font-size: 2.2rem;
}

.new-template-btn{
    background-color: #54c3ea;
    color: white;
    border: 1px solid #54c3ea;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(84, 195, 234, 0.2);
    white-space: nowrap;
}

.new-template-btn:hover{
    background-color: white;
    color: #54c3ea;
    transform: translateY(-2px);
}

.template-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px; /* Ruimte tussen de kaarten */
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.template-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    min-height: 220px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #e1e8ed;
    border-top: 5px solid #54c3ea;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.15);
    border-color: #54c3ea;
}

.template-name {
    color: #2d3436;
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.template-description {
    color: #636e72;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
    display: -webkit-box !important;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    text-overflow: ellipsis;
}


.button-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.edit-template-button, .delete-template-button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.edit-template-button {
    background-color: #f0f2f5;
    color: #4b5563;
}

.edit-template-button:hover {
    background-color: #e2e8f0;
    color: #1f2937;
    transform: scale(1.02);
}

.delete-template-button {
    background-color: #fee2e2;
    color: #ef4444;
}

.delete-template-button:hover {
    background-color: #fecaca;
    color: #dc2626;
    transform: scale(1.02);
}

.modal-template-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-top: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}


.modal-box {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.read-modal-section-title{
    border-bottom: 3px solid #54c3ea;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: #2d3436;
}

.info-input.input-error {
    border: 2px solid #ff4757 !important;
    background-color: #fff5f5 !important;
}

.error-message {
    display: none;
    align-items: center;
    gap: 5px;
    color: #ff4757;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 4px;
    animation: fadeInError 0.2s ease;
}

.error-message i {
    font-size: 0.9rem;
}

.duplicate-template-button {
    flex: 0.5;
    padding: 8px;
    border-radius: 8px;
    background-color: #e0f2fe;
    color: #0369a1;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.duplicate-template-button:hover {
    background-color: #bae6fd;
    transform: scale(1.05);
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MOBIEL (Telefoons) --- */
@media (max-width: 768px) {
    .templates-container {
        margin: 10px 15px;
    }

    .header-container {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        margin-bottom: 20px;
    }

    .templates-title {
        font-size: 1.8rem;
    }

    .template-cards-container {
        grid-template-columns: 1fr;
        padding: 5px;
    }

    .template-card {
        max-height: none;
        min-height: 180px;
    }
}

/* --- IPAD / TABLET STAAND (Portrait) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .templates-container {
        margin: 15px 25px;
    }

    .template-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- IPAD LANDSCAPE / LAPTOP --- */
@media (min-width: 1025px) and (max-width: 1440px) {
    .template-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* --- GROTE MONITOREN --- */
@media (min-width: 1441px) {
    .template-cards-container {
        grid-template-columns: repeat(5, 1fr);
    }
}