.ipsw-container { max-width: 1200px; margin: auto; padding: 20px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--secondary); border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.ipsw-list { list-style:none; padding:0; }
.ipsw-list li { margin:10px 0; }
.ipsw-list li a { text-decoration:none; color: var(--link-color); }
.ipsw-list li a:hover { color: var(--accent); }
.ipsw-portal__download-section { text-align: center; }
.ipsw-portal__download-btn { background: linear-gradient(135deg, var(--button), var(--accent)); color:#fff; padding:15px 30px; text-decoration:none !important; border-radius:8px; font-weight: bold; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.2); display:inline-block; }
.ipsw-portal__download-btn:hover { background: linear-gradient(135deg, var(--button-hover), var(--button)); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.3); text-decoration: none !important; }
.adsense-slot { margin:30px 0; text-align:center; border:2px dashed #ddd; padding:20px; background: #fff; border-radius: 8px; }

/* Placeholder styling for sample ads */
.adsense-slot.placeholder { min-height: 90px; display:flex; align-items:center; justify-content:center; background: linear-gradient(180deg, #fff, #fbfbfb); border-style: dashed; color: #666; }
.adsense-slot.placeholder .ads-placeholder { font-size:16px; color:#777; padding:12px 18px; border-radius:6px; background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0.01)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); }
.adsense-slot.placeholder .ads-placeholder small { display:block; font-size:12px; color:#999; margin-top:6px; }

/* New styles for IPSW layout */
.ipsw-heading{ text-align:center; margin:0px 0 40px; font-size:28px; color: var(--primary); text-shadow: 1px 1px 2px rgba(0,0,0,0.1); }
.ipsw-tabs{ display:flex; gap:15px; justify-content:center; margin:30px 0; }
.ipsw-tabs .tab{ padding:12px 20px; border:2px solid #ddd; background:#fff; cursor:pointer; border-radius:10px; font-weight: 600; transition: all 0.3s ease; color: #016584; }
.ipsw-tabs .tab.active{ background: linear-gradient(135deg, var(--primary), var(--accent)); color:#fff; border-color:var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.tab-content{ max-width:100%; margin:30px auto; padding: 20px; background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.section-title { color: var(--primary); }
.firmware-table{ width:100%; border-collapse:collapse; margin:15px 0 30px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.firmware-table th, .firmware-table td{ padding:15px 12px; border-bottom:1px solid #eee; text-align:left; font-size:15px; }
.firmware-table th { background: linear-gradient(135deg, var(--secondary), #e0e0e0); font-weight: bold; }
.firmware-table tr.fw-signed td:first-child a{ color: var(--primary); font-weight:600; }
.firmware-table tr.fw-unsigned td:first-child a{ color:#dc3545; font-weight:600; }
.firmware-table tr:hover { background: var(--secondary); }
.device-info-box{ background: linear-gradient(135deg, #f8f9fa, #e9ecef); border:1px solid #dee2e6; padding:20px; border-radius:10px; max-width:100%; margin:0 auto; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.device-info-box p { margin: 10px 0; font-size: 16px; }
.ipsw-portal__download-btn.large{ display:inline-block; padding:12px 26px; background:var(--button); color:#fff; border-radius:6px; text-decoration:none; }

@media (min-width:900px){
	.ipsw-container{ max-width:1300px; }
}

/* Product / device card grid */
.card-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:25px; margin:20px 0 50px; }
.products-grid{ grid-template-columns: repeat(4, 1fr); }
.products-grid > .adsense-slot { grid-column: 1 / -1; display: flex; justify-content: center; }
.products-grid > .adsense-slot .ads-placeholder { max-width: 728px; width: 100%; }
/* Make ad slots inside any card/grid span full width and center their content */
.card-grid > .adsense-slot, .card-grid > .adsense-slot.placeholder { grid-column: 1 / -1; display: flex; justify-content: center; }
.card-grid > .adsense-slot .ads-placeholder, .card-grid > .adsense-slot.placeholder .ads-placeholder { max-width: 728px; width: 100%; }
.product-card{ display:block; background: linear-gradient(135deg, var(--secondary), #ffffff); border:2px solid var(--border); border-radius:15px; text-align:center; text-decoration:none !important; color:inherit; box-shadow:0 8px 25px rgba(0,0,0,0.1); overflow:hidden; transition: all 0.3s ease; position: relative; padding-top: 20px; }
.product-card:hover{ transform:translateY(-5px); box-shadow:0 15px 35px rgba(0,0,0,0.15); border-color: var(--border-hover, var(--primary)); }
.product-card .card-media{ height:160px; background: linear-gradient(135deg, var(--secondary), #f3e5f5); display:flex; align-items:center; justify-content:center; position: relative; border-bottom: 1px solid var(--border); }
.product-card .card-title{ padding:18px 12px 22px; font-size:18px; font-weight:600; color: var(--font-color); }

/* Back button - REMOVED */
.back-btn { display: none; }

/* Breadcrumb Steps */
.ipsw-portal__breadcrumb { display: flex; justify-content: center; gap: 30px; align-items: flex-start; margin: 30px 0 10px; flex-wrap: nowrap; overflow-x: auto; padding: 20px; }
.ipsw-portal__breadcrumb .ipsw-portal__step { width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; background: transparent; color: #999; font-weight: 700; font-size: 12px; transition: all 0.25s ease; cursor: pointer; text-align: center; line-height: 1.2; white-space: nowrap; min-width: fit-content; flex-shrink: 0; position: relative; padding-top: 116px; }
/* hexagon background positioned absolutely so icon can be centered inside */
.ipsw-portal__breadcrumb .ipsw-portal__step::after { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 96px; height: 96px; background: #f5f5f5; border: 3px solid #ddd; clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); transition: all 0.25s ease; z-index: 1; }
.ipsw-portal__breadcrumb .ipsw-portal__step i { font-size: 34px; margin: 0; position: absolute; top: 26px; left: 50%; transform: translateX(-50%); z-index: 3; color: var(--primary); transition: all 0.25s ease; }
.ipsw-portal__breadcrumb .ipsw-portal__step .ipsw-portal__step-caption { display: block; margin-top: 8px; color: var(--font-color); font-size: 13px; }
.ipsw-portal__breadcrumb .ipsw-portal__step .ipsw-portal__step-main { display: block; margin-top: 6px; color: var(--primary); font-size: 14px; font-weight: 800; }

/* stronger placement: ensure title sits below hexagon */
.ipsw-container .ipsw-portal__breadcrumb .ipsw-portal__step .ipsw-portal__step-caption { margin-top: 8px; }
.ipsw-container .ipsw-portal__breadcrumb .ipsw-portal__step .ipsw-portal__step-main { margin-top: 6px; }
.ipsw-container .ipsw-portal__breadcrumb .ipsw-portal__step-arrow { margin-top: 64px; color: var(--primary); }
/* active state: hexagon colored, icon white */
.ipsw-portal__breadcrumb .ipsw-portal__step.active::after { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: var(--primary); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.ipsw-portal__breadcrumb .ipsw-portal__step.active i { color: #fff !important; transform: translateX(-50%) scale(1.05); }
.ipsw-portal__breadcrumb .ipsw-portal__step:hover::after { transform: translateX(-50%) scale(1.04); }
.ipsw-portal__breadcrumb .ipsw-portal__step-arrow { color: var(--primary); font-size: 24px; font-weight: bold; flex-shrink: 0; align-self: center; }

/* Responsive */
@media (max-width: 768px) {
    .card-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
    .ipsw-heading { font-size: 24px; }
    .firmware-table th, .firmware-table td { padding: 10px 8px; font-size: 14px; }
    .ipsw-tabs { flex-direction: column; align-items: center; }
    .ipsw-portal__breadcrumb { gap: 20px; margin: 20px 0 30px; }
    .ipsw-portal__breadcrumb .ipsw-portal__step::after { width: 70px; height: 70px; margin-bottom: 12px; }
    .ipsw-portal__breadcrumb .ipsw-portal__step i { font-size: 28px; }
    .ipsw-portal__breadcrumb .ipsw-portal__step .ipsw-portal__step-title { font-size: 9px; }
    .ipsw-portal__breadcrumb .ipsw-portal__step-arrow { font-size: 18px; }
}

/* Themes */
.theme-iphone { --primary: #007aff; --secondary: #e3f2fd; --accent: #0056cc; }
.theme-ipad { --primary: #28a745; --secondary: #e8f5e8; --accent: #1e7e34; }
.theme-ipodtouch { --primary: #6f42c1; --secondary: #f3f0ff; --accent: #5a32a3; }
.theme-applewatch { --primary: #dc3545; --secondary: #fceaea; --accent: #bd2130; }
.theme-appletv { --primary: #fd7e14; --secondary: #fff3cd; --accent: #d39e00; }
.theme-homepod { --primary: #20c997; --secondary: #e9f7f2; --accent: #17a2b8; }
.theme-mac { --primary: #6c757d; --secondary: #f8f9fa; --accent: #495057; }

/* Apply themes */
.ipsw-container {
    --primary: #0073aa;
    --secondary: #f9f9f9;
    --accent: #005f80;
}

.ipsw-heading { color: var(--primary); }
.ipsw-portal__download-btn { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.ipsw-portal__download-btn:hover { background: linear-gradient(135deg, var(--button-hover), var(--primary)); color: #fff !important; }
.ipsw-tabs .tab.active { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: var(--primary); }
.section-title { color: var(--primary); }
.firmware-table th { background: linear-gradient(135deg, var(--secondary), #e0e0e0); }
.product-card:hover { border-color: var(--primary); }
.signed-yes { color: var(--primary); font-weight: bold; }
.signed-no { color: #dc3545; font-weight: bold; }

/* IPSW Download Card */
.ipsw-download-card {
    background: linear-gradient(135deg, var(--secondary), #ffffff);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.ipsw-download-card h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 24px;
}

.ipsw-info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 30px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ipsw-info-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.ipsw-info-table td:first-child {
    font-weight: bold;
    background: var(--secondary);
    width: 30%;
}

.ipsw-info-table tr:last-child td {
    border-bottom: none;
}

.ipsw-portal__download-section {
    margin-top: 20px;
    text-align: center;
}

.ipsw-portal__download-section .ipsw-portal__download-btn {
    font-size: 18px;
    padding: 15px 40px;
    text-decoration: none !important;
}

/* Responsive override for products-grid specifically */
@media (max-width: 1024px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(1, 1fr); }
}

/* Ensure in responsive layouts the ad placeholder doesn't overflow */
@media (max-width: 768px) {
    .products-grid > .adsense-slot .ads-placeholder { max-width: 100%; }
}