﻿/*
    PayPalFlow V1

    Shared visual rules for:

    - payment page
    - payment result
    - transaction ledger
    - transaction verification

    Payment and verification logic remains server-side.
*/


/* ==========================================================
   Global rules
   ========================================================== */

* {
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
    color: #111;
}


a {
    color: #111;
    text-decoration: underline;
}


/* ==========================================================
   Containers
   ========================================================== */

.container {
    width: min( 90%, 900px );
    margin: 60px auto;
    padding: 32px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}


.ledger-container {
    width: min( 95%, 1400px );
}


/* ==========================================================
   Header
   ========================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}


    .page-header h1 {
        margin-top: 0;
    }


.page-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}


/* ==========================================================
   Product
   ========================================================== */

.environment {
    margin-bottom: 0;
}


.product {
    padding: 24px 0;
}


.price {
    font-size: 2rem;
    font-weight: bold;
}


button {
    padding: 14px 22px;
    border: 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}


    button:hover {
        opacity: 0.85;
    }


/* ==========================================================
   Definition lists
   ========================================================== */

dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    margin-top: 24px;
}


dt {
    font-weight: bold;
}


dd {
    margin: 0;
    overflow-wrap: anywhere;
}


/* ==========================================================
   Transaction summary
   ========================================================== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat( 4, minmax( 120px, 1fr ) );
    gap: 16px;
    margin-bottom: 32px;
}


.summary-card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}


    .summary-card span {
        display: block;
        margin-bottom: 8px;
        font-size: 0.9rem;
    }


    .summary-card strong {
        font-size: 1.7rem;
    }


/* ==========================================================
   Tables
   ========================================================== */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}


table {
    width: 100%;
    border-collapse: collapse;
}


th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}


th {
    background: #f7f7f7;
    white-space: nowrap;
}


.identifier {
    overflow-wrap: anywhere;
    font-family: Consolas, monospace;
    font-size: 0.85rem;
}


/* ==========================================================
   Status display
   ========================================================== */

.status {
    display: inline-block;
    padding: 5px 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}


/* ==========================================================
   Detail sections
   ========================================================== */

.detail-section {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #ddd;
}


    .detail-section h2 {
        margin-top: 0;
    }


/* ==========================================================
   Verification
   ========================================================== */

.verification-section {
    margin-bottom: 32px;
}


.verification {
    padding: 20px;
    border: 2px solid #bbb;
    border-radius: 8px;
    background: #fafafa;
}


    .verification strong {
        display: block;
        margin-bottom: 8px;
        font-size: 1.1rem;
    }


    .verification p:last-child {
        margin-bottom: 0;
    }


.verification-match {
    border-style: solid;
}


.verification-mismatch {
    border-style: dashed;
}


.verification-error {
    border-style: dotted;
}


/* ==========================================================
   Existing payment result
   ========================================================== */

.result {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
}


/* ==========================================================
   Empty ledger
   ========================================================== */

.empty-state {
    padding: 40px;
    border: 1px dashed #bbb;
    text-align: center;
}


/* ==========================================================
   Responsive
   ========================================================== */

@media ( max-width: 700px ) {

    .container {
        margin: 20px auto;
        padding: 20px;
    }


    .page-header {
        flex-direction: column;
    }


    .summary-grid {
        grid-template-columns: repeat( 2, 1fr );
    }


    dl {
        grid-template-columns: 1fr;
    }
}
