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

*:focus {
    outline: none;
}

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

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --danger-color: #FF4757;
    --success-color: #2ED573;
    --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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
}

/* Login Sayfası */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 50px 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
    border: 4px solid var(--primary-color);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #666;
    font-size: 1.1rem;
}

.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 3px solid #ddd;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.form-group .input-icon {
    position: absolute;
    right: 15px;
    top: 45px;
    font-size: 1.2rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
    padding: 15px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 50px; /* Touch-friendly minimum height */
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.4);
}

.error-message {
    background: #FFE5E5;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    border: 2px solid var(--danger-color);
}

.login-footer {
    margin-top: 25px;
    text-align: center;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Admin Paneli */
.admin-container {
    min-height: 100vh;
    padding: 20px;
}

.admin-header {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 3px solid var(--primary-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

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

.btn-header:hover {
    background: #3ba8a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-actions {
    margin-bottom: 30px;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 40px; /* iOS touch target minimum */
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.story-item {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5E1 100%);
    border-radius: 15px;
    padding: 20px 18px;
    box-shadow: var(--shadow);
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.story-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.story-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.story-item-icon {
    font-size: 50px;
}

.story-item-title {
    font-size: 1.2rem;
    color: #8B4513;
    font-weight: 700;
    flex: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.story-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-edit {
    padding: 8px 16px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-height: 40px;
}

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

.btn-delete {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-height: 40px;
}

.btn-delete:hover {
    background: #ff3838;
    transform: scale(1.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--primary-color);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--bg-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.modal-close {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #ff3838;
    transform: rotate(90deg);
}

.modal-form {
    margin-top: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    font-size: 1.1rem;
}

/* Tablet ve küçük ekranlar */
@media (max-width: 1024px) {
    .admin-container {
        padding: 15px;
    }

    .stories-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .modal-content {
        max-width: 90%;
    }
}

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

    .login-container {
        padding: 15px;
    }

    .login-box {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .login-icon {
        font-size: 50px;
    }

    .login-header h1 {
        font-size: 2rem;
    }

    .login-header p {
        font-size: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px 40px 12px 12px;
        font-size: 16px; /* iOS zoom'u önlemek için */
    }

    .btn-login {
        padding: 16px;
        font-size: 1.1rem;
    }

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

    .admin-header h1 {
        font-size: 1.8rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .btn-header {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }

    .admin-actions {
        margin-bottom: 20px;
    }

    .btn-primary {
        width: 100%;
        padding: 16px 25px;
        font-size: 1.1rem;
        justify-content: center;
    }

    .stories-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .story-item {
        padding: 20px 15px;
    }

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

    .story-item-title {
        font-size: 1.3rem;
    }

    .story-item-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-edit,
    .btn-delete {
        width: 100%;
        padding: 12px;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 25px 20px;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px;
    }

    .modal-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    .form-group textarea {
        min-height: 150px;
        font-size: 16px; /* iOS zoom'u önlemek için */
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 25px;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
        padding: 14px 20px;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state-icon {
        font-size: 60px;
    }

    .empty-state h3 {
        font-size: 1.5rem;
    }

    .empty-state p {
        font-size: 1rem;
    }
}

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

    .login-box {
        padding: 25px 15px;
    }

    .login-header h1 {
        font-size: 1.6rem;
    }

    .login-icon {
        font-size: 45px;
    }

    .admin-header {
        padding: 15px 12px;
    }

    .admin-header h1 {
        font-size: 1.5rem;
    }

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

    .story-item-icon {
        font-size: 35px;
    }

    .story-item-title {
        font-size: 1.2rem;
    }

    .modal-content {
        padding: 20px 15px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px 35px 12px 12px;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 320px) {
    .login-box {
        padding: 20px 12px;
    }

    .login-header h1 {
        font-size: 1.4rem;
    }

    .admin-header h1 {
        font-size: 1.3rem;
    }

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

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

    .modal-content {
        max-height: 90vh;
    }
}

/* Touch cihazlar için */
@media (hover: none) and (pointer: coarse) {
    .btn-header:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-edit:hover,
    .btn-delete:hover,
    .btn-login:hover {
        transform: none;
    }

    .btn-header:active,
    .btn-primary:active,
    .btn-secondary:active,
    .btn-edit:active,
    .btn-delete:active,
    .btn-login:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .story-item:hover {
        transform: none;
    }

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

    .modal-close:hover {
        transform: none;
    }

    .modal-close:active {
        transform: rotate(90deg) scale(0.95);
    }
}

