:root {
--primary-color: #1a5e63;
--secondary-color: #f1c40f;
--accent-color: #2c3e50;
--light-color: #f8f9fa;
--dark-color: #343a40;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Tahoma', 'Arial', sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
color: var(--dark-color);
line-height: 1.6;
min-height: 100vh;
padding-bottom: 2rem;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}

img {
pointer-events: none;
}

.container {
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}

header {
background: linear-gradient(to right, var(--primary-color), #2c7c82);
color: white;
padding: 1.5rem 0;
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
}

header::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header-content {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
z-index: 1;
}

.logo {
display: flex;
align-items: center;
margin-bottom: 0.5rem;
}

.logo i {
font-size: 2.5rem;
margin-left: 10px;
color: var(--secondary-color);
}

.logo h1 {
font-size: 1.8rem;
font-weight: 700;
}

.subtitle {
font-size: 1rem;
opacity: 0.9;
margin-top: 0.5rem;
}

main {
padding: 2rem 0;
}

.page-title {
text-align: center;
margin-bottom: 2rem;
color: var(--accent-color);
position: relative;
padding-bottom: 15px;
}

.page-title::after {
content: "";
position: absolute;
bottom: 0;
right: 50%;
transform: translateX(50%);
width: 100px;
height: 3px;
background: var(--secondary-color);
border-radius: 2px;
}

.search-box {
max-width: 500px;
margin: 0 auto 2rem;
position: relative;
}

.search-box input {
width: 100%;
padding: 12px 20px;
border: 2px solid #e0e0e0;
border-radius: 50px;
font-size: 1rem;
transition: var(--transition);
background: white;
box-shadow: var(--shadow);
}

.search-box input:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(26, 94, 99, 0.2);
}

.search-box i {
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
color: #777;
}

.random-ayah-section {
text-align: center;
margin-bottom: 2rem;
padding: 1.5rem;
background: white;
border-radius: 10px;
box-shadow: var(--shadow);
}

.random-ayah-title {
color: var(--accent-color);
margin-bottom: 1rem;
font-size: 1.3rem;
}

.spinner-btn {
background: linear-gradient(to right, var(--primary-color), #2c7c82);
color: white;
border: none;
padding: 15px 30px;
border-radius: 50px;
cursor: pointer;
font-weight: bold;
font-size: 1.1rem;
transition: var(--transition);
display: inline-flex;
align-items: center;
gap: 10px;
box-shadow: var(--shadow);
margin-bottom: 1rem;
position: relative;
overflow: hidden;
}

.spinner-btn:hover {
transform: translateY(-3px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.spinner-btn:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
}

.spinner-icon {
transition: var(--transition);
}

.loading-spinner {
display: none;
width: 20px;
height: 20px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: white;
animation: spin 1s linear infinite;
}

.spinning .spinner-icon {
display: none;
}

.spinning .loading-spinner {
display: block;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.random-ayah-result {
display: none;
margin-top: 1.5rem;
animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}

.random-ayah-card {
background: white;
border-radius: 10px;
padding: 1.5rem;
box-shadow: var(--shadow);
transition: var(--transition);
border: 2px solid var(--secondary-color);
text-align: center;
max-width: 500px;
margin: 0 auto;
position: relative;
overflow: hidden;
}

.random-ayah-card::before {
content: "";
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 5px;
background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
}

.random-ayah-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid #eee;
}

.random-ayah-number {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: var(--primary-color);
color: white;
border-radius: 50%;
font-weight: bold;
font-size: 0.9rem;
}

.random-ayah-sura {
font-weight: bold;
color: var(--accent-color);
}

.random-ayah-image-container {
width: 100%;
height: 200px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1rem;
background: #f8f9fa;
border-radius: 8px;
overflow: hidden;
position: relative;
}

.random-ayah-image {
max-width: 100%;
max-height: 100%;
border-radius: 8px;
transition: var(--transition);
opacity: 0;
}

.random-ayah-image.loaded {
opacity: 1;
}

.random-ayah-text {
font-size: 1.1rem;
color: #2c3e50;
margin: 1rem 0;
text-align: center;
line-height: 1.8;
padding: 0.5rem;
width: 100%;
background: rgba(26, 94, 99, 0.05);
border-radius: 8px;
border-right: 3px solid var(--primary-color);
}

.action-buttons {
display: flex;
justify-content: center;
gap: 1rem;
margin-top: 1rem;
flex-wrap: wrap;
}

.download-btn, .go-to-sura-btn, .listen-btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 10px 20px;
border-radius: 50px;
text-decoration: none;
font-weight: bold;
transition: var(--transition);
border: none;
cursor: pointer;
font-size: 0.9rem;
}

.download-btn {
background: var(--primary-color);
color: white;
}

.download-btn:hover {
background: #145257;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.go-to-sura-btn {
background: #6c757d;
color: white;
}

.go-to-sura-btn:hover {
background: #5a6268;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.listen-btn {
background: #28a745;
color: white;
}

.listen-btn:hover {
background: #218838;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.listen-btn.playing {
background: #dc3545;
}

.listen-btn.playing:hover {
background: #c82333;
}

.sura-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
}

.sura-card {
background: white;
border-radius: 10px;
padding: 1.5rem;
text-align: center;
box-shadow: var(--shadow);
transition: var(--transition);
border: 1px solid #eaeaea;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}

.sura-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
border-color: var(--primary-color);
}

.sura-number {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: var(--primary-color);
color: white;
border-radius: 50%;
font-weight: bold;
margin-bottom: 1rem;
font-size: 0.9rem;
}

.sura-name {
font-size: 1.2rem;
font-weight: bold;
color: var(--accent-color);
margin-bottom: 0.5rem;
}

.sura-card a {
text-decoration: none;
color: inherit;
display: block;
width: 100%;
}

footer {
background: var(--dark-color);
color: white;
text-align: center;
padding: 1.5rem 0;
margin-top: 2rem;
}

.footer-content {
display: flex;
flex-direction: column;
align-items: center;
}

.social-icons {
display: flex;
gap: 1rem;
margin: 1rem 0;
}

.social-icons a {
color: white;
font-size: 1.2rem;
transition: var(--transition);
}

.social-icons a:hover {
color: var(--secondary-color);
}

.copyright {
font-size: 0.9rem;
opacity: 0.8;
}

.whatsapp-banner {
background-color: #e8f5e9;
border: 1px solid #c8e6c9;
border-radius: 12px;
box-shadow: 0 3px 10px rgba(0,0,0,0.05);
direction: rtl;
padding: 12px 0;
width: 100%;
margin: 20px auto;
}

.whatsapp-content {
max-width: 900px;
margin: auto;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 0 20px;
color: #1b4332;
flex-wrap: wrap;
text-align: right;
justify-content: center;
}

.whatsapp-content i {
font-size: 26px;
color: #25D366;
}

.whatsapp-btn {
background: #25D366;
color: #fff;
padding: 6px 18px;
border-radius: 25px;
text-decoration: none;
font-weight: 600;
transition: 0.3s;
white-space: nowrap;
}

.whatsapp-btn:hover {
background: #1da851;
}

.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

a:focus, button:focus, input:focus {
outline: 2px solid var(--secondary-color);
outline-offset: 2px;
}

@media (max-width: 768px) {
.logo h1 {
font-size: 1.5rem;
}
.sura-grid {
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.sura-card {
padding: 1rem;
}
.random-ayah-card {
padding: 1rem;
}
.random-ayah-header {
flex-direction: column;
gap: 0.5rem;
}
.action-buttons {
flex-direction: column;
align-items: center;
}
.download-btn, .go-to-sura-btn, .listen-btn {
width: 100%;
max-width: 250px;
justify-content: center;
}
}

@media (max-width: 700px) {
.whatsapp-content {
flex-direction: column;
text-align: center;
gap: 8px;
}
}

@media (max-width: 480px) {
.logo {
flex-direction: column;
}
.logo i {
margin-left: 0;
margin-bottom: 0.5rem;
}
.sura-grid {
grid-template-columns: 1fr;
}
}