/* Certificate CRUD Management Plugin - Light Professional Style */

.cert-crud-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(117, 18, 230, 0.08);
    border: 1px solid rgba(117, 18, 230, 0.1);
    padding: 30px;
    margin: 20px auto;
    max-width: 1400px;
    width: 95%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.cert-crud-title {
    color: rgb(117, 18, 230);
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 600;
}

/* Action Buttons */
.cert-crud-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.cert-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.cert-btn-primary {
    background: rgb(117, 18, 230);
    color: white;
}

.cert-btn-primary:hover {
    background: rgb(97, 15, 190);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(117, 18, 230, 0.3);
}

.cert-btn-secondary {
    background: #6c757d;
    color: white;
}

.cert-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.cert-btn-search {
    background: #28a745;
    color: white;
}

.cert-btn-search:hover {
    background: #218838;
    transform: translateY(-1px);
}

.cert-btn-cancel {
    background: #dc3545;
    color: white;
}

.cert-btn-cancel:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Modal Styles */
.cert-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.cert-modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 30px;
    border: none;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.cert-close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.cert-close:hover {
    color: rgb(117, 18, 230);
}

/* Form Styles */
.cert-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.cert-form-group {
    display: flex;
    flex-direction: column;
}

.cert-form-group-full {
    grid-column: 1 / -1;
}

.cert-form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.cert-form-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.cert-form-group input:focus {
    outline: none;
    border-color: rgb(117, 18, 230);
    box-shadow: 0 0 0 3px rgba(117, 18, 230, 0.1);
}

.cert-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Search Container */
.cert-search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.cert-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.cert-search-input:focus {
    outline: none;
    border-color: rgb(117, 18, 230);
    box-shadow: 0 0 0 3px rgba(117, 18, 230, 0.1);
}

/* Table Styles */
.cert-table-container {
    background: #ffffff;
    border-radius: 8px;
    overflow-x: auto;
    border: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.cert-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background: #ffffff;
}

.cert-table th,
.cert-table td {
    padding: 15px 20px;
    text-align: right;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
}

.cert-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    font-size: 14px;
    border-bottom: 2px solid #d0d0d0;
}

.cert-table td {
    background: #ffffff;
    color: #333;
    font-size: 14px;
}

.cert-table tr:hover {
    background: rgba(117, 18, 230, 0.02);
}

.cert-table tr:nth-child(even) td {
    background: #fafafa;
}

.cert-table tr:nth-child(even):hover td {
    background: rgba(117, 18, 230, 0.05);
}

/* Action Buttons in Table */
.cert-table .cert-btn {
    padding: 8px 16px;
    font-size: 12px;
    margin: 0 5px;
    min-width: 70px;
    white-space: nowrap;
}

/* Actions Column */
.cert-table th:last-child,
.cert-table td:last-child {
    width: 180px;
    min-width: 180px;
    text-align: center;
}

.cert-btn-edit {
    background: #17a2b8;
    color: white;
}

.cert-btn-edit:hover {
    background: #138496;
}

.cert-btn-delete {
    background: #dc3545;
    color: white;
}

.cert-btn-delete:hover {
    background: #c82333;
}

/* Pagination */
.cert-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.cert-pagination button {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cert-pagination button:hover {
    background: rgb(117, 18, 230);
    color: white;
    border-color: rgb(117, 18, 230);
}

.cert-pagination button.active {
    background: rgb(117, 18, 230);
    color: white;
    border-color: rgb(117, 18, 230);
}

.cert-pagination button:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.cert-pagination span {
    color: #666;
    font-size: 14px;
    margin: 0 10px;
}

/* Loading Indicator */
.cert-loading {
    text-align: center;
    padding: 30px;
    color: rgb(117, 18, 230);
    font-size: 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.cert-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(117, 18, 230, 0.3);
    border-radius: 50%;
    border-top-color: rgb(117, 18, 230);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.cert-empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.cert-empty-state h3 {
    color: rgb(117, 18, 230);
    margin-bottom: 10px;
}

/* Custom Confirmation Dialog */
.cert-confirm-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: none;
}

.cert-confirm-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 30px;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 30px rgba(117, 18, 230, 0.2);
    animation: modalSlideIn 0.3s ease;
    text-align: center;
}

.cert-confirm-icon {
    width: 60px;
    height: 60px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    font-size: 24px;
}

.cert-confirm-title {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.cert-confirm-message {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.cert-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cert-confirm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.cert-confirm-btn-danger {
    background: #dc3545;
    color: white;
}

.cert-confirm-btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.cert-confirm-btn-secondary {
    background: #6c757d;
    color: white;
}

.cert-confirm-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Success/Error Messages */
.cert-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.cert-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cert-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cert-crud-container {
        padding: 20px;
        margin: 10px;
    }
    
    .cert-crud-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cert-form-grid {
        grid-template-columns: 1fr;
    }
    
    .cert-search-container {
        flex-direction: column;
    }
    
    .cert-table-container {
        overflow-x: auto;
    }
    
    .cert-table {
        min-width: 900px;
    }
    
    .cert-table th,
    .cert-table td {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .cert-table .cert-btn {
        padding: 6px 12px;
        font-size: 11px;
        margin: 0 3px;
        min-width: 60px;
    }
    
    .cert-table th:last-child,
    .cert-table td:last-child {
        width: 150px;
        min-width: 150px;
    }
    
    .cert-pagination {
        flex-wrap: wrap;
    }
    
    .cert-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .cert-crud-title {
        font-size: 24px;
    }
    
    .cert-table {
        min-width: 800px;
    }
    
    .cert-table th,
    .cert-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .cert-table .cert-btn {
        padding: 5px 8px;
        font-size: 10px;
        margin: 0 2px;
        min-width: 50px;
    }
    
    .cert-table th:last-child,
    .cert-table td:last-child {
        width: 120px;
        min-width: 120px;
    }
    
    .cert-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}