/* Sub-Center Dashboard Styles */
.sip-subcenter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Login Section */
.sip-login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.sip-login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.sip-login-box h2 {
    margin: 0 0 10px 0;
    color: #1d2327;
    font-size: 24px;
    font-weight: 600;
}

.sip-login-box p {
    margin: 0 0 30px 0;
    color: #646970;
    font-size: 14px;
}

.sip-login-form {
    text-align: left;
}

.sip-login-form .sip-form-group {
    margin-bottom: 20px;
}

.sip-login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.sip-login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.sip-login-form input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.sip-login-btn {
    width: 100%;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sip-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.3);
}

.sip-login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sip-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: sip-spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes sip-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dashboard Section */
.sip-dashboard-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sip-dashboard-header {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sip-center-info h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
}

.sip-center-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.sip-center-info code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.sip-dashboard-actions {
    display: flex;
    gap: 10px;
}

.sip-logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sip-logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Form Section */
.sip-form-section {
    padding: 30px;
    border-bottom: 1px solid #f0f0f1;
}

.sip-form-section h3 {
    margin: 0 0 20px 0;
    color: #1d2327;
    font-size: 20px;
    font-weight: 600;
}

.sip-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sip-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.sip-form-group {
    display: flex;
    flex-direction: column;
}

.sip-form-group.sip-full-width {
    grid-column: 1 / -1;
}

.sip-form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.sip-form-group .required {
    color: #d63638;
    margin-left: 3px;
}

.sip-form-group input,
.sip-form-group textarea,
.sip-form-group select {
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.sip-form-group input:focus,
.sip-form-group textarea:focus,
.sip-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.sip-form-group input.error,
.sip-form-group textarea.error {
    border-color: #d63638;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.1);
}

.sip-form-description {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #646970;
    font-style: italic;
}

.sip-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sip-submit-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sip-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.sip-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sip-submit-btn.sip-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.sip-cancel-btn {
    background: #f6f7f7;
    color: #646970;
    border: 1px solid #dcdcde;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sip-cancel-btn:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
}

/* List Section */
.sip-list-section {
    padding: 30px;
}

.sip-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.sip-section-header h3 {
    margin: 0;
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
}

.sip-search-box input {
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    font-size: 14px;
    min-width: 250px;
}

.sip-search-box input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Table Styles */
.sip-table-container {
    background: white;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sip-table th {
    background: #f6f7f7;
    color: #1d2327;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dcdcde;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sip-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.sip-table tbody tr:hover {
    background: #f9f9f9;
}

.sip-table tbody tr:last-child td {
    border-bottom: none;
}

.sip-student-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.sip-no-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #646970;
    font-size: 12px;
    border: 2px solid #e0e0e0;
}

.sip-na {
    color: #646970;
    font-style: italic;
}

.sip-action-buttons {
    display: flex;
    gap: 5px;
    position: relative;
}

.sip-edit-btn,
.sip-delete-btn {
    background: none;
    border: 1px solid #dcdcde;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.sip-edit-btn .dashicons,
.sip-delete-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.sip-edit-btn .sip-btn-text,
.sip-delete-btn .sip-btn-text {
    font-size: 10px;
    margin-left: 4px;
    display: none;
}

/* Show text when dashicons don't load */
.sip-edit-btn:not(:has(.dashicons)) .sip-btn-text,
.sip-delete-btn:not(:has(.dashicons)) .sip-btn-text {
    display: inline;
}

/* When no icons are available, show text and adjust button size */
.sip-edit-btn.sip-no-icons,
.sip-delete-btn.sip-no-icons {
    width: auto;
    min-width: 50px;
    padding: 6px 8px;
}

.sip-edit-btn.sip-no-icons .sip-btn-text,
.sip-delete-btn.sip-no-icons .sip-btn-text {
    display: inline !important;
    font-size: 11px;
    font-weight: 500;
}

/* Fallback for when Dashicons don't load */
.sip-edit-btn:not(:has(.dashicons)):before {
    content: "✏";
    font-family: Arial, sans-serif;
    font-size: 14px;
    display: block;
}

.sip-delete-btn:not(:has(.dashicons)):before {
    content: "🗑";
    font-family: Arial, sans-serif;
    font-size: 14px;
    display: block;
}

/* Alternative fallback using text */
.sip-edit-btn:not(:has(.dashicons)):after {
    content: "Edit";
    font-size: 10px;
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.sip-delete-btn:not(:has(.dashicons)):after {
    content: "Delete";
    font-size: 10px;
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.sip-edit-btn {
    color: #0073aa;
    border-color: #0073aa;
}

.sip-edit-btn:hover {
    background: #0073aa;
    color: white;
}

.sip-delete-btn {
    color: #d63638;
    border-color: #d63638;
}

.sip-delete-btn:hover {
    background: #d63638;
    color: white;
}

.sip-no-data,
.sip-loading,
.sip-error {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
    font-style: italic;
}

.sip-error {
    color: #d63638;
}

/* Messages */
.sip-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    z-index: 9999;
    animation: sip-slideIn 0.3s ease;
}

.sip-message-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.sip-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c2c7;
}

@keyframes sip-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sip-subcenter-container {
        padding: 10px;
    }
    
    .sip-login-box {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .sip-dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .sip-form-section,
    .sip-list-section {
        padding: 20px;
    }
    
    .sip-form-grid {
        grid-template-columns: 1fr;
    }
    
    .sip-section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sip-search-box input {
        min-width: auto;
        width: 100%;
    }
    
    .sip-table-container {
        overflow-x: auto;
    }
    
    .sip-table {
        min-width: 600px;
    }
    
    .sip-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sip-submit-btn,
    .sip-cancel-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sip-login-box {
        padding: 20px 15px;
    }
    
    .sip-form-section,
    .sip-list-section {
        padding: 15px;
    }
    
    .sip-form {
        padding: 20px;
    }
    
    .sip-table th,
    .sip-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .sip-student-photo,
    .sip-no-photo {
        width: 30px;
        height: 30px;
    }
}
