/* 
 * Frontend Portal Styles
 * Adapts the admin.css styles to be safely used on the frontend without bleeding.
 */
.srdm-frontend-portal {
    font-family: inherit;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    min-height: 80vh;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.srdm-frontend-error {
    background: #fff3f3;
    border-left: 4px solid #ef4444;
    padding: 16px;
    margin: 20px 0;
    font-weight: bold;
}

/* Sidebar */
.srdm-portal-sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.srdm-portal-sidebar h3 {
    color: #0ad593;
    padding: 0 20px 10px;
    margin: 0 0 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.2rem;
}

.srdm-portal-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.srdm-portal-menu li {
    margin: 0;
}

.srdm-portal-menu a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.srdm-portal-menu a:hover,
.srdm-portal-menu li.active a {
    background: rgba(10, 213, 147, 0.1);
    color: #0ad593;
    border-left-color: #0ad593;
}

/* Icons via emoji for simplicity on frontend if dashicons aren't loaded */
.srdm-portal-menu a i {
    display: inline-block;
    width: 24px;
    font-style: normal;
}

/* Content Area */
.srdm-portal-content {
    flex: 1;
    padding: 30px;
    min-width: 300px;
    background: #f8f9fa;
}

/* Inherited/Adapted Components from admin.css */
.srdm-portal-content .srdm-wrap {
    margin: 0;
    max-width: 100%;
}

.srdm-portal-content .srdm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.srdm-portal-content .srdm-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* Copy core components for independent functioning */
.srdm-portal-content .srdm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.srdm-portal-content .srdm-card,
.srdm-portal-content .srdm-card-table {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.srdm-portal-content .srdm-card-table {
    padding: 0;
    overflow: hidden;
}

.srdm-portal-content .srdm-table {
    width: 100%;
    border-collapse: collapse;
}

.srdm-portal-content .srdm-table th,
.srdm-portal-content .srdm-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.srdm-portal-content .srdm-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
}

.srdm-portal-content .srdm-btn {
    background: #0ad593;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: inline-block;
    text-decoration: none;
    transition: background 0.2s;
}

.srdm-portal-content .srdm-btn:hover {
    background: #09c386;
    color: #fff;
}

.srdm-portal-content .srdm-btn-secondary {
    background: #e2e8f0;
    color: #333;
}

.srdm-portal-content .srdm-btn-secondary:hover {
    background: #cbd5e1;
}

.srdm-portal-content .srdm-btn-danger {
    background: #ef4444;
}

.srdm-portal-content .srdm-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.srdm-portal-content .srdm-form-group {
    margin-bottom: 15px;
}

.srdm-portal-content .srdm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.srdm-portal-content .srdm-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.srdm-portal-content .srdm-badge.paid { background: #e0f8ee; color: #0ad593; }
.srdm-portal-content .srdm-badge.unpaid { background: #fee2e2; color: #ef4444; }

@media (max-width: 768px) {
    .srdm-frontend-portal {
        flex-direction: column;
    }
    .srdm-portal-sidebar {
        width: 100%;
        padding: 10px;
    }
    .srdm-portal-menu {
        display: flex;
        flex-wrap: wrap;
    }
    .srdm-portal-menu li {
        flex: 1;
        min-width: 120px;
    }
}

/* Custom Login Styles */
.srdm-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background: #f4f7f6;
    min-height: calc(100vh - 100px);
}
.srdm-login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 450px;
}
.srdm-login-header {
    text-align: center;
    margin-bottom: 30px;
}
.srdm-login-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 15px;
}
.srdm-login-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}
.srdm-role-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}
.srdm-role-option input {
    position: absolute;
    opacity: 0;
}
.srdm-role-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}
.srdm-role-box span {
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.2;
}
.srdm-role-option input:checked + .srdm-role-box {
    border-color: #0ad593;
    background: rgba(10, 213, 147, 0.05);
}
.srdm-role-option input:checked + .srdm-role-box .dashicons,
.srdm-role-option input:checked + .srdm-role-box span {
    color: #0ad593;
    font-weight: 600;
}

/* Admin Portal Specifics */
.srdm-admin-portal .srdm-portal-sidebar h3 {
    color: #e74c3c;
}
.srdm-sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 15px;
}
.srdm-badge.admin-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.srdm-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}
.srdm-switch-mode {
    color: #3498db !important;
}


/* Pagination */
.srdm-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 10px 0;
}

.srdm-pagination .page-numbers {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    background: #fff;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.srdm-pagination .page-numbers:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0ad593;
}

.srdm-pagination .page-numbers.current {
    background: #0ad593;
    color: #fff;
    border-color: #0ad593;
}

.srdm-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}
