* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #dfe6e9;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 70px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-edit, .btn-back, .btn-add, .btn-map {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

.btn-add {
    background: linear-gradient(135deg, var(--success-color), #229954);
}

.btn-map {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-edit:hover, .btn-back:hover, .btn-add:hover, .btn-map:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Overview Map Section */
.overview-map-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.map-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.overview-map-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 3px var(--border-color), var(--shadow);
    line-height: 0;
}

.overview-map-image {
    width: 100%;
    height: auto;
    display: block;
    -webkit-user-select: none;
    user-select: none;
    max-width: 100%;
}

.overview-marker {
    position: absolute;
    width: 35px;
    height: 35px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: markerPulse 2s infinite;
    z-index: 10;
}

.overview-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: rgba(231, 76, 60, 0.3);
    border-radius: 50%;
    animation: markerRipple 2s infinite;
}

.overview-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.overview-marker-label {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Miners Grid */
.miners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.miner-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.miner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.miner-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-color);
}

.miner-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.miner-avatar.small {
    width: 45px;
    height: 45px;
    font-size: 1rem;
}

.miner-name {
    flex: 1;
}

.miner-name h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.miner-id {
    color: var(--text-light);
    font-size: 0.9rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Detail Rows */
.miner-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 10px;
}

.detail-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.detail-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Location Dropdown */
.location-section {
    margin-top: 10px;
}

.location-dropdown {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.dropdown-toggle {
    display: none;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.dropdown-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.dropdown-icon {
    font-size: 1.3rem;
}

.dropdown-content {
    display: flex;
    flex-direction: column;
}

.dropdown-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.dropdown-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.dropdown-toggle:checked + .dropdown-header .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

.dropdown-toggle:checked ~ .dropdown-details {
    max-height: 300px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-of-type {
    border-bottom: none;
}

.item-icon {
    font-size: 1.2rem;
}

.item-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.item-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.dropdown-map {
    padding: 12px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.map-container-view {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 2px var(--border-color), var(--shadow);
    line-height: 0;
}

.map-container-view .map-image {
    max-width: 100%;
}

.map-marker-view {
    position: absolute;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: markerPulse 2s infinite;
}

.map-marker-view::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background: rgba(231, 76, 60, 0.3);
    border-radius: 50%;
    animation: markerRipple 2s infinite;
}

.map-marker-view::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #e74c3c;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.map-marker-view .marker-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.update-time {
    padding: 12px 16px;
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.update-icon {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Edit Page Styles */
.add-miner-container {
    margin-bottom: 30px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.edit-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
}

.edit-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-color);
}

.edit-header h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

/* Form Styles */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    min-width: 0;
}

.form-row .form-group input {
    width: 100%;
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.label-icon {
    font-size: 1.1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--card-bg);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Map Container */
.map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
    background: var(--bg-color);
    box-shadow: 0 0 0 3px var(--border-color), var(--shadow);
    transition: all 0.3s ease;
    line-height: 0;
}

.map-container:hover {
    box-shadow: 0 0 0 3px var(--secondary-color), var(--shadow-hover);
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
    -webkit-user-select: none;
    user-select: none;
    max-width: 100%;
}

.map-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: markerPulse 2s infinite;
}

.map-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(231, 76, 60, 0.3);
    border-radius: 50%;
    animation: markerRipple 2s infinite;
}

.map-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.marker-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

@keyframes markerPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes markerRipple {
    0% {
        width: 30px;
        height: 30px;
        opacity: 0.8;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

.map-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
    font-style: italic;
}

/* Map Upload Styles */
.map-upload-card {
    max-width: 800px;
    margin: 0 auto;
}

.current-map-preview {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
}

.preview-label {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.current-map-img {
    width: 100%;
    max-width: 100%;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: block;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn-save {
    flex: 1;
    background: linear-gradient(135deg, var(--success-color), #229954);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.btn-delete {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-color), #c0392b);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.btn-cancel {
    flex: 1;
    background: linear-gradient(135deg, var(--text-light), #5a6c7d);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.btn-save:hover, .btn-delete:hover, .btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-save:active, .btn-delete:active, .btn-cancel:active {
    transform: translateY(0);
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 100;
}

footer p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .miners-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .edit-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .miner-card {
        padding: 20px;
    }

    .miner-header {
        flex-wrap: wrap;
    }

    .status-badge {
        width: 100%;
        justify-content: center;
    }

    .btn-edit, .btn-back, .btn-add, .btn-map {
        padding: 10px 22px;
        font-size: 0.95rem;
    }

    .form-buttons {
        flex-direction: column;
    }

    .header-buttons {
        flex-direction: column;
        width: 100%;
    }

    .header-buttons .btn-back,
    .header-buttons .btn-add,
    .header-buttons .btn-map {
        width: 100%;
    }

    .overview-map-section {
        padding: 15px;
    }

    .map-title {
        font-size: 1.2rem;
    }

    /* Mobil harita düzeltmeleri */
    .overview-map-container {
        max-width: 100%;
        box-shadow: 0 0 0 2px var(--border-color), var(--shadow);
    }

    .overview-marker {
        width: 28px;
        height: 28px;
    }

    .overview-marker::before {
        width: 22px;
        height: 22px;
    }

    .overview-marker::after {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    .overview-marker-label {
        top: -24px;
        padding: 3px 7px;
        font-size: 0.65rem;
        border-radius: 10px;
    }

    .map-container {
        border-radius: 10px;
        box-shadow: 0 0 0 2px var(--border-color), var(--shadow);
    }

    .map-container:hover {
        box-shadow: 0 0 0 2px var(--secondary-color), var(--shadow-hover);
    }

    .map-marker {
        width: 32px;
        height: 32px;
    }

    .map-marker::before {
        width: 24px;
        height: 24px;
    }

    .map-marker::after {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }

    .marker-label {
        top: -26px;
        padding: 3px 8px;
        font-size: 0.7rem;
        border-radius: 10px;
    }

    .map-container-view {
        border-radius: 6px;
    }

    .map-marker-view {
        width: 24px;
        height: 24px;
    }

    .map-marker-view::before {
        width: 18px;
        height: 18px;
    }

    .map-marker-view::after {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }

    .map-marker-view .marker-label {
        top: -22px;
        padding: 2px 6px;
        font-size: 0.6rem;
        border-radius: 8px;
    }

    .dropdown-map {
        padding: 10px;
    }

    .map-hint {
        font-size: 0.85rem;
        margin-top: 8px;
    }

    @keyframes markerRipple {
        0% {
            width: 24px;
            height: 24px;
            opacity: 0.8;
        }
        100% {
            width: 45px;
            height: 45px;
            opacity: 0;
        }
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 16px;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .miner-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .miner-avatar.small {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .miner-name h2 {
        font-size: 1.1rem;
    }

    .detail-icon, .dropdown-icon, .item-icon {
        font-size: 1.1rem;
    }

    .edit-card {
        padding: 18px;
    }

    .edit-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .edit-header h3 {
        font-size: 1.1rem;
    }

    .edit-form {
        gap: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .current-map-preview {
        padding: 12px;
    }

    .current-map-img {
        max-height: 300px;
    }

    /* Çok küçük ekranlar için harita optimizasyonu */
    .overview-map-section {
        padding: 12px;
    }

    .map-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .overview-marker {
        width: 24px;
        height: 24px;
    }

    .overview-marker::before {
        width: 18px;
        height: 18px;
    }

    .overview-marker::after {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }

    .overview-marker-label {
        top: -20px;
        padding: 2px 6px;
        font-size: 0.6rem;
        border-radius: 8px;
    }

    .map-marker {
        width: 28px;
        height: 28px;
    }

    .map-marker::before {
        width: 20px;
        height: 20px;
    }

    .map-marker::after {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    .marker-label {
        top: -22px;
        padding: 2px 6px;
        font-size: 0.65rem;
    }

    .map-marker-view {
        width: 20px;
        height: 20px;
    }

    .map-marker-view::before {
        width: 16px;
        height: 16px;
    }

    .map-marker-view::after {
        width: 10px;
        height: 10px;
        border-width: 1px;
    }

    .map-marker-view .marker-label {
        top: -18px;
        padding: 2px 5px;
        font-size: 0.55rem;
    }

    .dropdown-map {
        padding: 8px;
    }

    .map-hint {
        font-size: 0.8rem;
    }

    @keyframes markerRipple {
        0% {
            width: 20px;
            height: 20px;
            opacity: 0.8;
        }
        100% {
            width: 40px;
            height: 40px;
            opacity: 0;
        }
    }
}
