/**
 * Painel do Paciente - Frontend Styles
 * Design: Calm Clinical
 */

/* ===== CSS Variables ===== */
:root {
    --pdp-bg: #F8F6F3;
    --pdp-white: #FFFFFF;
    --pdp-text-primary: #2D3748;
    --pdp-text-secondary: #718096;
    --pdp-text-muted: #A0AEC0;
    --pdp-accent: #6B9080;
    --pdp-accent-hover: #5A7A6B;
    --pdp-accent-light: #EDF5F0;
    --pdp-border: #E2E8F0;
    --pdp-border-light: #EDF2F7;
    --pdp-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --pdp-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --pdp-radius: 12px;
    --pdp-radius-sm: 8px;
    --pdp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    --pdp-transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
.pdp-dashboard {
    font-family: var(--pdp-font);
    color: var(--pdp-text-primary);
    background: var(--pdp-bg);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pdp-dashboard *,
.pdp-dashboard *::before,
.pdp-dashboard *::after {
    box-sizing: border-box;
}

.pdp-dashboard a {
    color: var(--pdp-accent);
    text-decoration: none;
    transition: var(--pdp-transition);
}

.pdp-dashboard a:hover {
    color: var(--pdp-accent-hover);
}

/* ===== Header ===== */
.pdp-header {
    background: var(--pdp-white);
    border-bottom: 1px solid var(--pdp-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pdp-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.pdp-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pdp-brand-icon {
    width: 32px;
    height: 32px;
}

.pdp-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pdp-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pdp-text-primary);
}

.pdp-brand-sub {
    font-size: 11px;
    color: var(--pdp-text-secondary);
}

/* ===== Navigation ===== */
.pdp-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.pdp-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--pdp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--pdp-text-secondary);
    transition: var(--pdp-transition);
    white-space: nowrap;
}

.pdp-nav-item:hover {
    color: var(--pdp-text-primary);
    background: var(--pdp-border-light);
}

.pdp-nav-item.active {
    color: var(--pdp-text-primary);
    font-weight: 600;
}

.pdp-nav-item svg {
    flex-shrink: 0;
}

/* ===== Header User ===== */
.pdp-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.pdp-header-notification {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--pdp-transition);
    color: var(--pdp-text-secondary);
}

.pdp-header-notification:hover {
    background: var(--pdp-border-light);
}

.pdp-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.pdp-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.pdp-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--pdp-text-primary);
}

.pdp-mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--pdp-text-primary);
}

/* ===== Main Content ===== */
.pdp-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== Welcome Section ===== */
.pdp-welcome {
    margin-bottom: 24px;
}

.pdp-welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--pdp-text-primary);
    margin: 0 0 4px 0;
}

.pdp-welcome-subtitle {
    font-size: 15px;
    color: var(--pdp-text-secondary);
    margin: 0;
}

/* ===== Appointment Card ===== */
.pdp-appointment-card {
    background: var(--pdp-white);
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--pdp-shadow);
}

.pdp-appointment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pdp-appointment-icon {
    width: 44px;
    height: 44px;
    background: var(--pdp-accent-light);
    border-radius: var(--pdp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdp-appointment-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.pdp-appointment-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--pdp-border-light);
}

.pdp-appointment-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pdp-appointment-detail svg {
    margin-top: 2px;
    flex-shrink: 0;
}

.pdp-appointment-detail > div {
    display: flex;
    flex-direction: column;
}

.pdp-detail-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--pdp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.pdp-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--pdp-text-primary);
}

.pdp-detail-sub {
    font-size: 13px;
    color: var(--pdp-text-secondary);
}

.pdp-appointment-empty {
    padding: 16px 0;
    text-align: center;
    color: var(--pdp-text-secondary);
}

/* ===== Buttons ===== */
.pdp-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-radius-sm);
    background: var(--pdp-white);
    color: var(--pdp-text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--pdp-transition);
    white-space: nowrap;
}

.pdp-btn-outline:hover {
    border-color: var(--pdp-accent);
    color: var(--pdp-accent);
}

.pdp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== Bottom Grid ===== */
.pdp-bottom-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
}

/* ===== Cards ===== */
.pdp-card {
    background: var(--pdp-white);
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-radius);
    padding: 24px;
    box-shadow: var(--pdp-shadow);
}

.pdp-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--pdp-text-primary);
}

.pdp-card-description {
    font-size: 14px;
    color: var(--pdp-text-secondary);
    margin: -8px 0 16px 0;
}

.pdp-card-footer {
    text-align: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--pdp-border-light);
}

.pdp-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--pdp-text-secondary);
}

.pdp-link:hover {
    color: var(--pdp-accent);
}

/* ===== Receipts List ===== */
.pdp-receipts-list {
    display: flex;
    flex-direction: column;
}

.pdp-receipt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--pdp-border-light);
}

.pdp-receipt-item:last-child {
    border-bottom: none;
}

.pdp-receipt-icon {
    width: 36px;
    height: 36px;
    background: var(--pdp-border-light);
    border-radius: var(--pdp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdp-receipt-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pdp-receipt-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pdp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdp-receipt-date {
    font-size: 12px;
    color: var(--pdp-text-secondary);
}

.pdp-receipt-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--pdp-text-primary);
    white-space: nowrap;
    margin-right: 12px;
}

.pdp-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-radius-sm);
    background: var(--pdp-white);
    color: var(--pdp-text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--pdp-transition);
    white-space: nowrap;
    text-decoration: none;
}

.pdp-btn-download:hover {
    border-color: var(--pdp-accent);
    color: var(--pdp-accent);
    background: var(--pdp-accent-light);
}

/* ===== Upload Area ===== */
.pdp-upload-area {
    border: 2px dashed var(--pdp-border);
    border-radius: var(--pdp-radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--pdp-transition);
    position: relative;
}

.pdp-upload-area:hover,
.pdp-upload-area.pdp-drag-over {
    border-color: var(--pdp-accent);
    background: var(--pdp-accent-light);
}

.pdp-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pdp-upload-icon {
    margin-bottom: 4px;
}

.pdp-upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--pdp-text-primary);
    margin: 0;
}

.pdp-upload-subtext {
    font-size: 13px;
    color: var(--pdp-text-secondary);
    margin: 0;
}

.pdp-upload-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--pdp-text-muted);
}

/* ===== Upload Progress ===== */
.pdp-upload-progress {
    margin-top: 16px;
}

.pdp-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--pdp-border-light);
    border-radius: 2px;
    overflow: hidden;
}

.pdp-progress-fill {
    height: 100%;
    background: var(--pdp-accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.pdp-progress-text {
    display: block;
    font-size: 12px;
    color: var(--pdp-text-secondary);
    margin-top: 6px;
    text-align: center;
}

/* ===== Upload Success ===== */
.pdp-upload-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--pdp-accent-light);
    border-radius: var(--pdp-radius-sm);
    margin-top: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pdp-accent);
}

/* ===== Sent Files ===== */
.pdp-sent-files {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--pdp-border-light);
}

.pdp-sent-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--pdp-text-primary);
}

.pdp-sent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pdp-border-light);
}

.pdp-sent-item:last-of-type {
    border-bottom: none;
}

.pdp-sent-icon {
    width: 32px;
    height: 32px;
    background: var(--pdp-border-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdp-sent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pdp-sent-filename {
    font-size: 13px;
    font-weight: 500;
    color: var(--pdp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdp-sent-date {
    font-size: 11px;
    color: var(--pdp-text-secondary);
}

.pdp-sent-status {
    flex-shrink: 0;
}

/* ===== Empty State ===== */
.pdp-empty-state {
    padding: 24px;
    text-align: center;
    color: var(--pdp-text-secondary);
    font-size: 14px;
}

/* ===== Login Form ===== */
.pdp-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pdp-bg);
    padding: 24px;
}

.pdp-login-card {
    background: var(--pdp-white);
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-radius);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--pdp-shadow-md);
    text-align: center;
}

.pdp-login-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--pdp-text-primary);
}

.pdp-login-card p {
    font-size: 14px;
    color: var(--pdp-text-secondary);
    margin: 0 0 24px 0;
}

.pdp-login-card label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--pdp-text-primary);
    margin-bottom: 4px;
}

.pdp-login-card input[type="text"],
.pdp-login-card input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    transition: var(--pdp-transition);
    font-family: var(--pdp-font);
}

.pdp-login-card input[type="text"]:focus,
.pdp-login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--pdp-accent);
    box-shadow: 0 0 0 3px rgba(107, 144, 128, 0.1);
}

.pdp-login-card input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--pdp-accent);
    color: white;
    border: none;
    border-radius: var(--pdp-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--pdp-transition);
    font-family: var(--pdp-font);
}

.pdp-login-card input[type="submit"]:hover {
    background: var(--pdp-accent-hover);
}

.pdp-login-links {
    margin-top: 16px;
}

.pdp-login-links a {
    font-size: 13px;
    color: var(--pdp-text-secondary);
}

.pdp-login-links a:hover {
    color: var(--pdp-accent);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .pdp-bottom-grid {
        grid-template-columns: 1fr;
    }

    .pdp-appointment-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pdp-header-inner {
        padding: 0 16px;
    }

    .pdp-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--pdp-white);
        border-bottom: 1px solid var(--pdp-border);
        flex-direction: column;
        padding: 12px 16px;
        box-shadow: var(--pdp-shadow-md);
    }

    .pdp-nav.pdp-nav-open {
        display: flex;
    }

    .pdp-nav-item {
        padding: 12px 16px;
        width: 100%;
    }

    .pdp-header-user {
        display: none;
    }

    .pdp-mobile-toggle {
        display: flex;
        margin-left: auto;
    }

    .pdp-main {
        padding: 20px 16px;
    }

    .pdp-welcome-title {
        font-size: 22px;
    }

    .pdp-appointment-card {
        padding: 16px;
    }

    .pdp-appointment-header {
        flex-wrap: wrap;
    }

    .pdp-appointment-header .pdp-btn-outline {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .pdp-appointment-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pdp-card {
        padding: 16px;
    }

    .pdp-receipt-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pdp-receipt-amount {
        margin-left: 48px;
        margin-right: auto;
    }

    .pdp-btn-download {
        margin-left: 48px;
    }

    .pdp-bottom-grid {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .pdp-brand-text {
        display: none;
    }

    .pdp-receipt-item {
        padding: 12px 0;
    }

    .pdp-receipt-amount {
        margin-left: 0;
        order: 3;
        width: 100%;
    }

    .pdp-btn-download {
        margin-left: 0;
        order: 4;
    }
}

/* ===== WordPress overrides ===== */
.pdp-dashboard img {
    max-width: 100%;
    height: auto;
}

/* Hide WP admin bar spacing when on dashboard page */
body.logged-in.admin-bar .pdp-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.logged-in.admin-bar .pdp-header {
        top: 46px;
    }
}

.pdp-section{display:none;}
.pdp-section.active{display:block;}
