/* Keep html sized to the viewport, but avoid forcing body to an exact
   height so it can grow when content expands (prevents layout clipping).
*/
html {
    height: 100%;
}

/* Skip link for keyboard navigation accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #d53369;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #770b2f;
    outline-offset: 2px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    box-sizing: border-box;
    padding: 20px;
    background: linear-gradient(135deg, #d53369 0%, #cbad6d 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
}

.card {
    max-width: 600px; /* move the width constraint to the card so the body background fills the viewport */
    margin: 20px auto;
    background: white;
    border-radius: 16px;
    padding: 20px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    color: #d53369;
    margin-bottom: 20px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.logo-inline {
    height: 1em;
    width: auto;
    vertical-align: middle;
    display: inline;
    white-space: nowrap;
}

.greeting {
    font-size: 1.1em;
    line-height: 1.5;
    color: #333;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.detail {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #d53369;
}

.detail-title {
    font-weight: 600;
    color: #d53369;
    margin-bottom: 5px;
}

.detail-value {
    color: #555;
}

.note {
    margin-top: 20px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9em;
}

.note a {
    color: #d53369;
    text-decoration: underline;
}

.note a:hover {
    color: #b02855;
    text-decoration: underline;
}

.footer {
    max-width: 600px;
    margin: 20px auto 0;
    text-align: left;
    font-size: 0.85em;
    font-style: italic;
    color: #ffffff;
}

.footer a {
    color: #ffffff;
    text-decoration: underline;
}

.footer a:hover {
    color: #770b2f; /* old #667eea*/
    text-decoration: underline;
}

/* Improved focus states for keyboard navigation */
a:focus,
button:focus {
    outline: 3px solid #770b2f;
    outline-offset: 2px;
}

/* Ensure sufficient color contrast */
.detail-value {
    color: #333; /* Darker for better contrast */
}

/* Fix text selection behavior to only highlight selected text */
.detail, .detail-title, .detail-value {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Ensure text selection background only covers the actual text */
::selection {
    background: rgba(213, 51, 105, 0.2);
    color: inherit;
}

::-moz-selection {
    background: rgba(213, 51, 105, 0.2);
    color: inherit;
}

/* Share functionality styles */
.share-section {
    margin-top: 20px;
    text-align: center;
}

.share-btn, .copy-btn {
    background: linear-gradient(135deg, #d53369 0%, #cbad6d 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(213, 51, 105, 0.3);
    margin: 5px;
}

.share-btn:hover, .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(213, 51, 105, 0.4);
}

.share-btn:active, .copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(213, 51, 105, 0.3);
}

.share-fallback {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.share-fallback.hidden {
    display: none;
}

.social-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    text-decoration: none;
    font-size: 1.2em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.social-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transform: translateX(300px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.copy-success.show {
    transform: translateX(0);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .card {
        margin: 10px auto;
        padding: 20px 20px; /* Reduced horizontal padding from 40px to 20px for mobile */
    }
    
    h1 {
        flex-wrap: wrap;
        font-size: 1.6em; /* Slightly smaller on mobile to reduce wrapping */
    }
    
    .footer {
        margin: 10px auto 0;
    }
}
