/**
 * Paideia Group Credential Management Styles
 */

/* Credentials Tab Content */
#paideia-credentials-content {
    padding: 20px 0;
}

#paideia-credentials-content h2 {
    margin-bottom: 20px;
}

.credential-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.credential-actions button {
    margin: 0;
}

/* Credentials Table */
#credentials-table-wrapper {
    background: #fff;
    padding: 0;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

#credentials-table-wrapper table {
    margin: 0;
    border: none;
}

#credentials-tbody .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Password Modal */
.paideia-modal {
    display: block;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.paideia-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 500px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideIn 0.3s;
}

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

.paideia-modal-content h3 {
    margin: 0;
    padding: 15px 20px;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
    font-size: 18px;
}

.paideia-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    margin-top: -5px;
}

.paideia-modal-close:hover,
.paideia-modal-close:focus {
    color: #000;
}

.credential-info {
    padding: 20px;
}

.credential-info p {
    margin: 10px 0;
}

.credential-info code {
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 14px;
}

.password-field {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}

.password-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

.password-display input {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
}

.password-display input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}

#copy-password {
    white-space: nowrap;
}

.modal-footer {
    padding: 15px 20px;
    background: #f1f1f1;
    border-top: 1px solid #ddd;
    text-align: right;
}

.credential-info .notice {
    margin: 0 0 15px 0;
}

.credential-info .description {
    color: #666;
    font-style: italic;
    font-size: 12px;
    margin-top: 5px;
}

/* Tab Navigation Enhancement */
.paideia-tabs {
    margin-bottom: 20px;
}

#credential-tab {
    position: relative;
}

#credential-tab.nav-tab-active {
    background: #fff;
    border-bottom-color: #fff;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .credential-actions {
        flex-direction: column;
    }
    
    .credential-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #credentials-table-wrapper {
        overflow-x: auto;
    }
    
    #credentials-table-wrapper table {
        min-width: 600px;
    }
    
    .paideia-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .password-display {
        flex-direction: column;
        align-items: stretch;
    }
    
    .password-display input,
    .password-display button {
        width: 100%;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button States */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success/Error States */
.credential-success {
    color: #008a20;
}

.credential-error {
    color: #d63638;
}

/* Print Styles */
@media print {
    .paideia-modal,
    .credential-actions,
    .nav-tab-wrapper {
        display: none !important;
    }
    
    #paideia-credentials-content {
        padding: 0;
    }
    
    #credentials-table-wrapper {
        border: 1px solid #000;
        box-shadow: none;
    }
}