/**
 * Diabetes Network Portal Styles
 * File location: /wp-content/plugins/diabetes-network-portal/assets/css/portal-styles.css
 */

/* Base Font Size Reset - Ensure consistent 16px base */
.container,
body {
    font-size: 16px !important;
}


@media (min-width: 1200px) {
  .container {
    width: 100% !important;
  }
}

/* General Styles */
.dn-dashboard-wrapper {
    min-height: 80vh;
}

/* Form Styles */
.form-control:focus {
    border-color: #009eaf;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 3px) center;
    background-size: calc(0.75em + 6px) calc(0.75em + 6px);
    padding-right: calc(1.5em + 12px);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 3px) center;
    background-size: calc(0.75em + 6px) calc(0.75em + 6px);
    padding-right: calc(1.5em + 12px);
}

/* Card Styles */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 8px;
}

.card-img-top {
    border-top-left-radius: calc(8px - 1px);
    border-top-right-radius: calc(8px - 1px);
    height: 200px;
    object-fit: cover;
}

/* Study Card Styles */
.study-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.study-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #009eaf;
}

.study-card .card-body {
    padding: 24px;
}

.study-card .card-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 12px;
    line-height: 1.4;
}

.study-card .card-text {
    color: #6c757d;
    font-size: 15.2px;
    line-height: 1.6;
}

/* Button Styles */
.btn {
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #009eaf !important;
    border-color: #009eaf !important;
}

.btn-primary:hover {
    background-color: #fff !important;
    border-color: #009eaf !important;
    color: #009eaf !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 245, 253, 0.486);
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
    color: #fff !important;
}

/* Dashboard Header */
.bg-primary {
    background-color: #009eaf !important;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 8px 12px;
    font-size: 14px;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* List Group Styles */
.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.list-group-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.list-group-item-action.active {
    background-color: #009eaf;
    border-color: #009eaf;
    color: white;
}

/* Modal Styles */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Shadow Utilities */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.075) !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .dn-dashboard-wrapper .bg-primary {
        text-align: center;
    }
    
    .study-card {
        margin-bottom: 24px;
    }
    
    .card-body {
        padding: 16px !important;
    }
}

/* Loading Spinner */
.dn-loading {
    display: inline-block;
    width: 32px;
    height: 32px;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: dn-spinner 0.75s linear infinite;
}

@keyframes dn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Form Validation Feedback */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 4px;
    font-size: 0.875em;
    color: #dc3545;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 16px;
}

.empty-state i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 16px;
}

/* Profile Avatar Placeholder */
.profile-avatar {
    width: 80px;
    height: 80px;
    background-color: #009eaf;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 16px;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Accessibility */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    outline: 2px solid #009eaf;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .btn,
    .navbar,
    .modal,
    .alert {
        display: none !important;
    }
}


/* Account menu styling */
.list-group-item {
    border: none;
    padding: 12px 0;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    padding-left: 8px;
}

.list-group-item.active {
    background-color: #e7f1ff !important;
    color: #009eaf !important;
    border-left: 3px solid #009eaf !important;
    padding-left: 8px !important;
    border-bottom: none;
    border-top: none;
}

.list-group-item i {
    margin-right: 8px;
    width: 20px;
}

.bi {
    display: inline-block;
    vertical-align: middle;
}

/* Sticky Sidebar Styles for Dashboard Templates */
.sticky-sidebar {
    position: sticky;
    top: 50px;
    z-index: 100;
}

@media (max-width: 768px) {
    .sticky-sidebar {
        position: relative;
        top: auto;
    }
}

/* Modern Dashboard Styles */
.welcome-section {
    padding: 32px 0;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 0;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-card-blue {
    border-left-color: #009eaf;
}

.stat-card-green {
    border-left-color: #198754;
}

.stat-card-purple {
    border-left-color: #6f42c1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-card-blue .stat-icon {
    background:#009eaf;
    color: white;
}

.stat-card-green .stat-icon {
    background:  #198754;
    color: white;
}

.stat-card-purple .stat-icon {
    background: #6f42c1;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-icon-sm {
    width: 40px;
    height: 40px;
    background: #009eaf;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.section-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    line-height: 10px;
    margin-top: 15px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.info-item {
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.info-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: #212529;
    font-weight: 600;
}

/* Action List */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: #f8f9fa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.action-item:hover {
    background: #e7f1ff;
    transform: translateX(4px);
}

.action-item-danger:hover {
    background: #fee;
}

.action-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #009eaf;
    flex-shrink: 0;
}

.action-item-danger .action-icon {
    color: #dc3545;
}

.action-content {
    flex: 1;
}

.action-title {
    font-weight: 600;
    color: #212529;
    font-size: 15px;
    margin-bottom: 2px;
}

.action-desc {
    font-size: 14px;
    color: #6c757d;
    line-height: 16px;
}

.action-arrow {
    color: #adb5bd;
    font-size: 18px;
}

.action-item:hover .action-arrow {
    color: #009eaf;
}

.action-item-danger:hover .action-arrow {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 990px) {
    .welcome-title {
        font-size: 24px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ENHANCED RESPONSIVE DESIGN
   ============================================ */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Sidebar adjustments */
    .sticky-sidebar {
        position: relative;
        top: auto;
        margin-bottom: 32px;
    }
    
    /* Dashboard grid adjustments */
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    /* Stat cards in 2 columns */
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    /* Content sections */
    .content-section {
        padding: 20px;
    }
    
    /* Welcome section */
    .welcome-title {
        font-size: 28px;
    }
    
    .welcome-subtitle {
        font-size: 16px;
    }
}

/* Small Tablets (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    /* Stack sidebar on top */
    .sticky-sidebar {
        position: relative;
        top: auto;
        margin-bottom: 32px;
    }
    
    /* Account menu as horizontal cards */
    .list-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .list-group-item {
        text-align: center;
        padding: 16px;
        border-radius: 8px !important;
        border: 1px solid #e9ecef !important;
    }
    
    .list-group-item.active {
        border: 2px solid #009eaf !important;
    }
    
    /* Dashboard adjustments */
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .stat-icon {
        margin-bottom: 12px;
    }
    
    /* Welcome section */
    .welcome-section {
        padding: 24px 0;
    }
    
    .welcome-title {
        font-size: 24px;
    }
    
    .welcome-subtitle {
        font-size: 16px;
    }
    
    /* Content sections */
    .content-section,
    .form-section {
        padding: 20px;
    }
    
    .form-section-body {
        padding: 24px !important;
    }
    
    /* Action items */
    .action-item {
        padding: 14px;
    }
    
    .action-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Mobile (max 480px) */
@media (max-width: 480px) {
    /* Container padding */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Sidebar - Full width horizontal menu */
    .sticky-sidebar {
        position: relative;
        top: auto;
        margin-bottom: 24px;
    }
    
    .list-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .list-group-item {
        padding: 14px 16px;
        border-radius: 8px !important;
        border: 1px solid #e9ecef !important;
        font-size: 15px;
    }
    
    .list-group-item.active {
        border: 2px solid #009eaf !important;
        background-color: #e7f1ff !important;
    }
    
    .list-group-item i {
        width: 24px;
    }
    
    /* Dashboard layout */
    .welcome-section {
        padding: 16px 0;
    }
    
    .welcome-title {
        font-size: 20px;
    }
    
    .welcome-subtitle {
        font-size: 15px;
    }
    
    /* Stat cards - single column, compact */
    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .stat-content {
        width: 100%;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    /* Info grid - single column */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .info-item {
        padding-bottom: 12px;
    }
    
    .info-label {
        font-size: 13px;
    }
    
    .info-value {
        font-size: 15px;
    }
    
    /* Content sections */
    .content-section {
        padding: 16px;
        border-radius: 12px;
    }
    
    .section-icon-sm {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .section-header h4 {
        font-size: 18px;
    }
    
    /* Form sections */
    .form-section {
        border-radius: 12px;
        margin-bottom: 24px !important;
    }
    
    .form-section-header {
        padding: 16px !important;
    }
    
    .form-section-body {
        padding: 16px !important;
    }
    
    .form-section-header h4 {
        font-size: 18px;
    }
    
    .form-section-header p {
        font-size: 13px;
    }
    
    /* Form controls */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    .input-with-icon .form-control {
        padding-left: 44px;
    }
    
    .input-with-icon .input-icon {
        font-size: 16px;
        left: 14px;
    }
    
    /* Action items */
    .action-list {
        gap: 8px;
    }
    
    .action-item {
        padding: 12px;
        gap: 12px;
    }
    
    .action-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .action-title {
        font-size: 14px;
    }
    
    .action-arrow {
        font-size: 16px;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 10px 20px !important;
        font-size: 16px !important;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Study cards */
    .study-card {
        margin-bottom: 16px;
    }
    
    .study-card .card-body {
        padding: 16px !important;
    }
    
    .study-card .card-title {
        font-size: 18px;
    }
    
    .study-card .card-text {
        font-size: 14px;
    }
    
    /* Badges */
    .badge {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Page header */
    .page-header h2 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
}

/* Extra Small Devices (max 360px) */
@media (max-width: 360px) {
    .welcome-title {
        font-size: 18px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .content-section {
        padding: 14px;
    }
    
    .form-section-header,
    .form-section-body {
        padding: 14px !important;
    }
    
    .action-item {
        padding: 10px;
    }
    
    .action-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sticky-sidebar {
        position: relative;
        top: auto;
    }
    
    .welcome-section {
        padding: 12px 0;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .form-section {
        margin-bottom: 16px !important;
    }
}

/* ============================================
   AUTH FORMS (Login & Registration)
   ============================================ */

/* Auth Page Wrapper */
.auth-page-wrapper {
    min-height: 100vh;
    padding: 32px 0;
    background: #f8f9fa;
}

/* Auth Card */
.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

/* Auth Card Header */
.auth-card-header {
    padding: 48px 32px 32px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.auth-icon {
    font-size: 64px;
    line-height: 1;
    color: #009eaf;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #212529;
}

.auth-subtitle {
    font-size: 16px;
    color: #6c757d;
    margin: 0;
}

/* Auth Card Body */
.auth-card-body {
    padding: 40px 32px;
}

/* Auth Card Footer */
.auth-card-footer {
    padding: 24px 32px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Form Groups */
.form-group-modern {
    margin-bottom: 24px;
}

.form-group-modern .form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 15px;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #009eaf;
    font-size: 18px;
    z-index: 2;
}

.input-with-icon .form-control {
    padding-left: 48px;
    padding-right: 16px;
    height: 52px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-with-icon .form-control:focus {
    border-color: #009eaf;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Buttons */
.btn-block {
    height: 52px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 17px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Links */
.auth-link {
    color: #009eaf;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.auth-link-primary {
    color: #009eaf;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link-primary:hover {
    color: #0a58ca;
}

/* Form Check */
.form-check-input:checked {
    background-color: #009eaf;
    border-color: #009eaf;
}

.form-check-label {
    font-size: 15px;
    color: #4a5568;
    font-weight: 400;
}

/* Custom Checkbox */
.custom-checkbox .form-check-input {
    width: 20px;
    height: 20px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
}

.custom-checkbox .form-check-input:checked {
    background-color: #009eaf;
    border-color: #009eaf;
}

.custom-checkbox .form-check-label {
    font-size: 15px;
    color: #4a5568;
    margin-left: 8px;
}

/* Info Box */
.info-box {
    background: #f0f4ff;
    border-left: 3px solid #009eaf;
    padding: 16px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #4a5568;
}

.info-box i {
    color: #009eaf;
    font-size: 20px;
}

/* Form Text */
.form-text {
    display: block;
    font-size: 14px;
    color: #718096;
}

/* Auth Forms Responsive */
@media (max-width: 768px) {
    .auth-page-wrapper {
        padding: 16px 0;
    }
    
    .auth-card-header {
        padding: 32px 24px 24px;
    }
    
    .auth-card-body {
        padding: 32px 24px;
    }
    
    .auth-icon {
        font-size: 48px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .input-with-icon .form-control {
        font-size: 15px;
    }
}