* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

*:focus {
    outline: none;
}

button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 50%, #FECFEF 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-color);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Uçan dekoratif öğeler */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star, .cloud, .rainbow {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.7;
}

.star1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    font-size: 2.5rem;
}

.star2 {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
    font-size: 2rem;
}

.star3 {
    bottom: 30%;
    left: 20%;
    animation-delay: 2s;
    font-size: 3rem;
}

.star4 {
    top: 50%;
    right: 10%;
    animation-delay: 1.5s;
    font-size: 2.2rem;
}

.cloud1 {
    top: 5%;
    left: 50%;
    font-size: 3rem;
    animation-delay: 0.5s;
    animation-duration: 8s;
}

.cloud2 {
    bottom: 10%;
    right: 30%;
    font-size: 2.5rem;
    animation-delay: 2.5s;
    animation-duration: 10s;
}

.rainbow {
    top: 15%;
    right: 5%;
    font-size: 4rem;
    animation-delay: 3s;
    animation-duration: 7s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #FFE5B4 0%, #FFCCCB 50%, #FFB6C1 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 3px solid #FF6B9D;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon, .logo-icon-right {
    font-size: 40px;
    animation: bounce 2s infinite;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-icon-right {
    animation-delay: 0.5s;
}

@keyframes bounce {
    0%, 100% { 
        transform: translateY(0) scale(1) rotate(0deg); 
    }
    25% { 
        transform: translateY(-15px) scale(1.1) rotate(-5deg); 
    }
    50% { 
        transform: translateY(-20px) scale(1.15) rotate(0deg); 
    }
    75% { 
        transform: translateY(-15px) scale(1.1) rotate(5deg); 
    }
}

h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #FF1744, #FF6B9D, #4ECDC4, #FFE66D);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    animation: rainbowText 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.3);
    margin: 0 15px;
}

@keyframes rainbowText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1rem;
    color: #8B4513;
    font-weight: 500;
    margin-top: 10px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

.welcome-message {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #FF6B9D;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.welcome-message p {
    font-size: 0.95rem;
    color: #8B4513;
    font-weight: 600;
    margin: 0;
}

.welcome-emoji {
    font-size: 1.2rem;
    animation: wave 1s ease-in-out infinite;
}

.welcome-emoji:nth-child(3) {
    animation-delay: 0.5s;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-20deg); }
    75% { transform: rotate(20deg); }
}

.stories-intro {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.5rem;
    color: #FF6B9D;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.section-subtitle {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    animation: fadeInUp 0.6s ease-out;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 16px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 157, 0.3);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(255, 107, 157, 0.3);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.page-btn:disabled:hover {
    background: white;
    color: var(--primary-color);
    transform: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5E1 100%);
    border-radius: 15px;
    padding: 20px 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.story-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 157, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.story-card:hover::before {
    opacity: 1;
}

.story-card:hover {
    transform: translateY(-15px) scale(1.05) rotate(2deg);
    box-shadow: 0 15px 35px rgba(255, 107, 157, 0.4);
    border-color: #FF6B9D;
    background: linear-gradient(135deg, #FFE5F1 0%, #FFF5E1 100%);
}

.story-card:nth-child(1) {
    border-color: #FF6B9D;
}

.story-card:nth-child(2) {
    border-color: #4ECDC4;
}

.story-card:nth-child(3) {
    border-color: #FFE66D;
}

.story-card:nth-child(4) {
    border-color: #FF9A9E;
}

.story-card:nth-child(5) {
    border-color: #A8E6CF;
}

.story-card:nth-child(6) {
    border-color: #FFD3A5;
}

.story-card-icon {
    font-size: 50px;
    margin-bottom: 12px;
    display: block;
    animation: iconBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.story-card:hover .story-card-icon {
    transform: scale(1.2) rotate(10deg);
    animation: none;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.story-card h3 {
    font-size: 1.2rem;
    color: #8B4513;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: color 0.3s ease;
}

.story-card:hover h3 {
    color: #FF6B9D;
}

.story-card p {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    font-weight: 500;
}

.story-viewer {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.back-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
}

.back-btn:hover {
    background: #3ba8a0;
    transform: translateX(-5px);
}

.story-content h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.story-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
    text-align: justify;
}

.story-text .highlight {
    background: var(--accent-color);
    padding: 2px 4px;
    border-radius: 4px;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 12px;
    margin-bottom: 15px;
}

#audioPlayer {
    width: 100%;
    max-width: 500px;
    margin: 10px 0;
    border-radius: 8px;
    background: var(--card-bg);
}

#audioPlayer:not([style*="display: none"]) {
    display: block !important;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 40px; /* iOS touch target minimum */
}

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

.btn-primary:hover {
    background: #e55a8a;
    transform: scale(1.05);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #3ba8a0;
    transform: scale(1.05);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.speed-control label {
    font-weight: 600;
    color: var(--text-color);
}

.speed-control input[type="range"] {
    width: 150px;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.speed-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

#speedValue {
    font-weight: 600;
    color: var(--text-color);
    min-width: 40px;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
}

.admin-link {
    display: inline-block;
    margin-top: 15px;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Tablet ve küçük ekranlar */
@media (max-width: 1024px) {
    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 3rem;
    }
}

/* Mobil cihazlar */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .floating-elements {
        display: none;
    }

    .container {
        max-width: 100%;
    }

    header {
        padding: 15px 12px;
        border-radius: 15px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 1.5rem;
        margin: 0 8px;
    }

    .logo {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo-icon, .logo-icon-right {
        font-size: 40px;
    }

    .subtitle {
        font-size: 1rem;
        margin-top: 10px;
    }

    .welcome-message {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        margin-top: 15px;
    }

    .welcome-message p {
        font-size: 1rem;
        text-align: center;
    }

    .welcome-emoji {
        font-size: 1.5rem;
    }

    .stories-intro {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 25px;
    }

    .story-card {
        padding: 20px 15px;
        border-radius: 20px;
    }

    .story-card-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .story-card h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .story-card p {
        font-size: 0.95rem;
    }

    .story-viewer {
        padding: 20px 15px;
        border-radius: 15px;
        margin-bottom: 25px;
    }

    .back-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .story-content h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .story-text {
        font-size: 0.95rem;
        padding: 15px 12px;
        line-height: 1.7;
        min-height: 150px;
        max-height: 50vh;
    }

    .controls {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .btn {
        padding: 12px 25px;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }

    .speed-control {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
        padding: 10px 0;
    }

    .speed-control input[type="range"] {
        width: 100%;
        max-width: 200px;
    }

    footer {
        padding: 15px;
        font-size: 0.85rem;
    }

    .admin-link {
        padding: 8px 16px;
        font-size: 0.9rem;
        margin-top: 10px;
    }

    .pagination {
        margin: 20px 0;
        gap: 6px;
    }

    .page-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 38px;
        min-height: 38px;
    }
}

/* Küçük mobil cihazlar */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    header {
        padding: 20px 12px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .logo-icon, .logo-icon-right {
        font-size: 35px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .welcome-message {
        padding: 12px;
    }

    .welcome-message p {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.85rem;
    }

    .story-card {
        padding: 18px 12px;
    }

    .story-card-icon {
        font-size: 45px;
    }

    .story-card h3 {
        font-size: 1.2rem;
    }

    .story-viewer {
        padding: 15px 10px;
    }

    .story-content h2 {
        font-size: 1.3rem;
    }

    .story-text {
        font-size: 0.95rem;
        padding: 15px 12px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .speed-control label {
        font-size: 0.9rem;
    }

    #speedValue {
        font-size: 0.9rem;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 320px) {
    h1 {
        font-size: 1.4rem;
    }

    .logo-icon, .logo-icon-right {
        font-size: 30px;
    }

    .story-card {
        padding: 15px 10px;
    }

    .story-card-icon {
        font-size: 40px;
    }

    .story-card h3 {
        font-size: 1.1rem;
    }
}

/* Yatay mod (landscape) için */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch cihazlar için */
@media (hover: none) and (pointer: coarse) {
    .story-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .story-card:active {
        transform: scale(0.98);
    }
}

