/* Base styles */
body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background-color: #ffffff;
    color: #111111;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.topnav {
    overflow: hidden;
    background-color: hotpink; /* Background color of the navigation bar */
    position: relative;
}

.topnav a {
    float: left;
    display: block;
    color: #f2f2f2; /* Text color of the navigation links */
    text-align: center;
    padding: 14px 16px; /* Padding around the navigation links */
    text-decoration: none; /* Remove default link underline */
    font-size: 17px; /* Font size of the navigation links */
}

.topnav a.whatsapp {
    font-size: 20px;
    line-height: 1;
}

.topnav a:hover {
    background-color: #ddd; /* Background color of the navigation link on hover */
    color: black; /* Text color of the navigation link on hover */
}

.topnav a.active {
    background-color: hotpink; /* Background color of the active navigation link */
    color: white; /* Text color of the active navigation link */
}

.topnav .icon {
    display: none; /* Hide the hamburger icon by default */
}

.nav-balance {
    float: right;
    margin: 10px 12px 0 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    user-select: none;
    white-space: nowrap;
}

/* Responsive styles for navigation */
@media screen and (max-width: 600px) {
    body {
        padding-top: 52px;
    }

    .topnav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .topnav a:not(:first-child) {
        display: none;
    }
    .topnav a.icon {
        float: right;
        display: block;
    }
    .nav-balance {
        position: absolute;
        right: 54px;
        top: 6px;
        margin: 0;
    }
}

@media screen and (max-width: 600px) {
    .topnav.responsive {
        position: relative;
    }
    .topnav.responsive .icon {
        position: absolute;
        right: 0;
        top: 0;
    }
    .topnav.responsive a {
        float: none;
        display: block;
        text-align: left;
    }
}

/* Container styles */
.container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* iPhone simulation styles */
.iphone {
    width: 300px;
    height: 450px;
    max-width: 100%;
    border: 2px solid #ccc;
    border-radius: 40px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
}

.header {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.inbox {
    height: calc(100% - 60px);
    overflow-y: auto;
}

.message {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: #f9f9f9;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 10px;
}

.circle-teal { background-color: teal; color: white; }
.circle-purple { background-color: purple; color: white; }
.circle-orange { background-color: orange; color: white; }
.circle-blue { background-color: blue; color: white; }

.message-content {
    flex-grow: 1;
}

.message-content p {
    margin: 6px 0 0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}

.sender {
    font-weight: bold;
}

.time {
    float: right;
    font-size: 12px;
    color: gray;
}

.ads-banner {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #111111 0%, #1b0c14 45%, #111111 100%);
    border: 1px solid rgba(255, 105, 180, 0.75);
    box-shadow: 0 0 0 1px rgba(255, 105, 180, 0.15), 0 8px 18px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    animation: adsPulse 2.6s ease-in-out infinite;
}

.ads-banner::before {
    content: "";
    position: absolute;
    inset: -40% -30%;
    background: radial-gradient(circle at 20% 20%, rgba(255, 105, 180, 0.22), rgba(255, 105, 180, 0) 55%);
    transform: rotate(8deg);
    pointer-events: none;
}

.ads-kicker {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ff5aa5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 90, 165, 0.12);
    border: 1px solid rgba(255, 90, 165, 0.25);
    padding: 4px 8px;
    border-radius: 999px;
}

.ads-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ff5aa5;
    box-shadow: 0 0 0 3px rgba(255, 90, 165, 0.18);
}

.ads-typing {
    margin-top: 4px;
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: normal;
    min-height: 18px;
    position: relative;
}

.ads-typing::after {
    content: "|";
    margin-left: 2px;
    opacity: 0.8;
    animation: adsBlink 0.8s steps(1) infinite;
}

@keyframes adsBlink {
    50% { opacity: 0; }
}

@keyframes adsPulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 0 1px rgba(255, 105, 180, 0.15), 0 8px 18px rgba(0, 0, 0, 0.22); }
    50% { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 105, 180, 0.22), 0 10px 22px rgba(0, 0, 0, 0.28); }
}

/* Input styles */
.inputs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: min(420px, 100%);
    max-width: 100%;
}

textarea, select, input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
    letter-spacing: normal;
    text-align: left;
}

textarea {
    min-height: 100px;
    height: auto;
    resize: vertical;
    overflow: hidden;
    max-height: 220px;
    -webkit-overflow-scrolling: touch;
}

#recipientPhone {
    min-height: 60px;
    max-height: 140px;
}

#statusBox {
    width: 100%;
}

.helper-text {
    width: 100%;
    margin: 8px 0 6px;
    font-size: 13px;
    line-height: 1.35;
    color: #555;
    overflow-wrap: anywhere;
}

.helper-text.error {
    color: #b91c1c;
    font-weight: 700;
}

.status-card {
    width: 100%;
    border-radius: 14px;
    padding: 12px 12px;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.status-card.success {
    border-color: rgba(4, 170, 109, 0.35);
    background: rgba(4, 170, 109, 0.08);
}

.status-card.error {
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.08);
}

.status-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 6px;
}

.status-meta {
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-title {
    margin-top: 14px;
    font-weight: 800;
    font-size: 16px;
}

.admin-card {
    width: 100%;
    margin-top: 10px;
    border-radius: 20px;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

.admin-two-col {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.brand-tabs .brand-tab-btn {
    white-space: nowrap;
}

.brand-tab-btn {
    flex: 1;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
}

.brand-tab-btn:hover {
    background: #f3f4f6;
}

.brand-tab-btn.active {
    background: hotpink;
    border-color: hotpink;
    color: #ffffff;
}

.brand-panel {
    padding: 0;
}

.brand-panel-scroll {
    padding: 12px;
    max-height: 68vh;
    overflow-y: auto;
}

.admin-two-col .admin-card {
    margin-top: 10px;
}

.plans-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.plan-card {
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-card.selected {
    border-color: rgba(4, 170, 109, 0.45);
    box-shadow: 0 6px 18px rgba(4, 170, 109, 0.18);
}

.plan-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.plan-name {
    font-weight: 900;
    font-size: 14px;
}

.plan-price {
    font-weight: 900;
    font-size: 14px;
    color: #046b45;
    white-space: nowrap;
}

.plan-meta {
    font-size: 12px;
    color: #555;
    line-height: 1.35;
}

.plan-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.plan-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.plan-btn.primary {
    border-color: rgba(4, 170, 109, 0.35);
    background: rgba(4, 170, 109, 0.12);
    color: #046b45;
}

.plan-btn:hover {
    background: #f3f4f6;
}

.plan-btn.primary:hover {
    background: rgba(4, 170, 109, 0.18);
}

.admin-subtitle {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
}

#usersList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #ffffff;
}

.user-row .u1 {
    font-weight: 700;
    font-size: 14px;
}

.user-row .u2 {
    font-size: 13px;
    color: #555;
    overflow-wrap: anywhere;
}

.user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mini-button {
    padding: 10px 14px;
    background-color: hotpink;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.mini-button:hover {
    background-color: #039c5d;
}

.auth-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.about-body {
    text-align: left;
    line-height: 1.55;
    color: #222;
    font-size: 14px;
}

.about-body p {
    margin: 0 0 10px;
}

.sender-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.sender-table th, .sender-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
    word-break: normal;
}

.sender-table thead th {
    font-weight: 800;
    color: #333;
    background: #fafafa;
}

#signupPage, #otpPage, #resetPage {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #ffffff;
    box-sizing: border-box;
}

.otp-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0 14px;
}

.otp-box {
    width: 44px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #ffffff;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    outline: none;
}

.otp-box:focus {
    border-color: rgba(4, 170, 109, 0.5);
    box-shadow: 0 0 0 3px rgba(4, 170, 109, 0.12);
}

.mini-button.danger {
    background-color: #dc2626;
}

.mini-button.danger:hover {
    background-color: #b91c1c;
}

#senderIdList, #pendingSenderIds, #specialDayList {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.pill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #ffffff;
}

.pill-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pill-name {
    font-weight: 800;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.pill-status {
    font-size: 12px;
    color: #555;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eee;
    color: #111;
    white-space: nowrap;
}

.badge.approved {
    background: rgba(4, 170, 109, 0.15);
    color: #046b45;
    border: 1px solid rgba(4, 170, 109, 0.25);
}

.badge.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #7a5b00;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

/* Button styles */
.button {
    padding: 15px 25px;
    font-size: 24px;
    text-align: center;
    cursor: pointer;
    outline: none;
    color: #fff;
    background-color: #04AA6D;
    border: none;
    border-radius: 15px;
    box-shadow: 0 9px #999;
}

.button:hover {
    background-color: hotpink;
}

.button:active {
    background-color: #3e8e41;
    box-shadow: 0 5px #666;
    transform: translateY(4px);
}

/* Responsive styles for the container */
@media screen and (max-width: 600px) {
    .container {
        flex-direction: column;
        align-items: center;
        padding: 12px;
        gap: 12px;
    }

    .iphone {
        width: 100%;
        height: auto;
        border-radius: 28px;
        padding: 16px;
    }

    textarea, select, input {
        width: 100%;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .admin-two-col {
        grid-template-columns: 1fr;
    }
}

/* Styles for the template page */
#templates-page {
    padding: 20px;
    text-align: center;
}

#templates-page h2 {
    margin-bottom: 20px;
}

#templates-page .templates {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.flip-box {
    background-color: transparent;
    width: 300px;
    height: 200px;
    border: 1px solid #f1f1f1;
    perspective: 1000px;
}

.flip-box-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-box:hover .flip-box-inner {
    transform: rotateY(180deg);
}

.flip-box-front, .flip-box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-box-front {
    background-color: #bbb;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-box-back {
    background-color: dodgerblue;
    color: white;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.use-template-button {
    margin-top: 20px;
    padding: 10px;
    background-color: hotpink;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.use-template-button:hover {
    background-color: #039c5d;
}
