/* E-Certificate System Styles */

/* Dashboard Layout */
#ecert-instructor-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ecert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.ecert-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

/* Certificate Counter */
.certificate-counter {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    min-width: 200px;
}

.counter-number {
    display: block;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.counter-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Dashboard Actions */
.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    margin: 2px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Form Styling */
#ecert-create-certificates {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: 20px 0;
}

.form-step {
    margin-bottom: 30px;
}

.form-step h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 25px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Certificate Preview */
.certificate-preview {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    min-height: 200px;
}

.preview-header {
    text-align: center;
    margin-bottom: 20px;
}

.preview-field {
    margin: 8px 0;
    font-weight: 600;
    color: #495057;
    min-height: 20px;
}

.red-line {
    border: none;
    height: 3px;
    background: #dc3545;
    margin: 20px 0;
}

.preview-content {
    text-align: center;
    font-style: italic;
    color: #6c757d;
}

/* Form Fields */
.form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-group input,
.field-group select,
.field-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field-group textarea {
    resize: vertical;
    min-height: 80px;
}

.field-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Certificates Remaining Counter */
.certificates-remaining {
    text-align: center;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#remaining-count {
    font-size: 24px;
    font-weight: 700;
}

/* Student Input Options */
.student-input-options {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
}

.input-method-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid #dee2e6;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #495057;
}

.input-method {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* File Upload Styling */
input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #5a6fd8;
    background: #e9ecef;
}

/* Certificate List */
#ecert-certificate-list {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: 20px 0;
}

#ecert-certificate-list h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 25px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.certificates-table {
    overflow-x: auto;
    margin-top: 20px;
}

.certificates-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.certificates-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.certificates-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.certificates-table tr:hover {
    background: #f8f9fa;
}

.certificates-table tr:last-child td {
    border-bottom: none;
}

.actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ecert-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .dashboard-actions {
        flex-direction: column;
    }
    
    .form-fields {
        grid-template-columns: 1fr;
    }
    
    .certificates-table {
        font-size: 14px;
    }
    
    .certificates-table th,
    .certificates-table td {
        padding: 10px 8px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-small {
        margin: 1px 0;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    border-left: 4px solid;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Certificate Preview Animation */
.certificate-preview {
    transition: all 0.3s ease;
}

.certificate-preview.updated {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

/* Form Validation */
.field-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}

/* Progress Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.step.active {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.step.inactive {
    background: #e9ecef;
    color: #6c757d;
}

.step.completed {
    background: #28a745;
    color: white;
}

/* Admin Styles */
.wrap .card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: none;
}

.wp-list-table.striped > tbody > :nth-child(odd),
.wp-list-table.striped > tbody > :nth-child(odd) td {
    background-color: #f9f9f9;
}

/* Print Styles */
@media print {
    .btn,
    .actions,
    .dashboard-actions {
        display: none !important;
    }
    
    .certificates-table {
        box-shadow: none;
    }
    
    .certificates-table th {
        background: #333 !important;
        color: white !important;
    }
}