:root {
    --bg-main: #fcf9f9;
    --card-bg: #ffffff;
    --primary: #b94b68;
    --primary-hover: #9e3c55;
    --accent-gold: #c2952b;
    --accent-gold-light: #fefaf0;
    --whatsapp-green: #25D366;
    --whatsapp-hover: #1ebd5a;
    --text-dark: #2c2225;
    --text-muted: #7d7073;
    --border-color: #f0e2e4;
    --shadow-card: 0 10px 25px rgba(185, 75, 104, 0.07);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    direction: rtl;
    line-height: 1.6;
    padding-bottom: 60px;
}

/* شريط الإهداء الفاخر */
.randa-tribute-bar {
    background: linear-gradient(90deg, #ffeef2, #fff9e6, #ffeef2);
    border-bottom: 1px solid #ebd4d8;
    padding: 7px 12px;
    text-align: center;
    font-size: 0.82rem;
    color: #8c3b50;
    letter-spacing: 0.2px;
}

.randa-tribute-bar strong {
    color: #b94b68;
    font-weight: 700;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.logo-area h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
}

.logo-area p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.icon-btn {
    background: #fdf5f6;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 50%;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 22px 0 16px 0;
}

.action-bar h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.btn {
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.primary-btn {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(185, 75, 104, 0.25);
}

.primary-btn:hover { background-color: var(--primary-hover); }

.secondary-btn {
    background-color: #f1e7e8;
    color: var(--text-dark);
}

.gold-btn {
    background-color: var(--accent-gold);
    color: #fff;
    box-shadow: 0 4px 10px rgba(194, 149, 43, 0.25);
}

.whatsapp-btn {
    background-color: var(--whatsapp-green);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover { background-color: var(--whatsapp-hover); }

.small-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aunt-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-card);
    position: relative;
}

.card-top-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
}

.card-control-btn {
    background: #fdf2f4;
    border: 1px solid var(--border-color);
    color: #7d7073;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-control-btn.delete-btn:hover { color: #c92a2a; background: #fee8e8; }
.card-control-btn.edit-btn:hover { color: var(--primary); background: #fcecef; }

.aunt-avatar-wrapper {
    width: 95px;
    height: 95px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--accent-gold));
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(185, 75, 104, 0.15);
}

.aunt-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.aunt-avatar-fallback {
    font-size: 2.3rem;
}

.aunt-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.aunt-tagline {
    font-size: 0.85rem;
    color: var(--primary);
    background-color: #fff0f3;
    padding: 3px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
    font-weight: 500;
}

.card-actions {
    width: 100%;
}

.card-actions button {
    width: 100%;
    font-size: 0.95rem;
    padding: 11px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 24, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.modal.hidden { display: none; }

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 24px;
    max-height: 92vh;
    overflow-y: auto;
}

.modal-content.large-modal { max-width: 480px; }

.modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 14px;
    text-align: right;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    outline: none;
    font-family: inherit;
}

.form-group textarea { resize: vertical; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions button { flex: 1; }

.tribute-box {
    background-color: var(--accent-gold-light);
    border-right: 4px solid var(--accent-gold);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 15px;
    text-align: right;
}

.tribute-box textarea {
    width: 100%;
    border: 1px solid #e8d8b5;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #4a3e1d;
    outline: none;
}

.canvas-box {
    margin-top: 15px;
    text-align: center;
}

#tribute-canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

.share-actions-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.hidden { display: none !important; }
