:root {
    --background-color: #f5f5f7;
    --card-background: #ffffff;
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --accent-color: #0071e3;
    --border-radius: 12px;
    --spacing: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(120deg, #f7f8fa 0%, #d2e3fc 40%, #a3bffa 100%);
    color: var(--text-color);
    line-height: 1.5;
}

.dark body {
    background: linear-gradient(120deg, #181c22 0%, #23272f 40%, #0e1624 100%);
    color: #f5f5f7;
}

.dark .platform-card {
    background: #232326;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.dark .subtitle,
.dark .stats,
.dark .content p,
.dark footer {
    color: #b0b0b5;
}

.dark .platform-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dark .media-container {
    background: #232326;
}

.dark .error-message {
    background: rgba(255, 59, 48, 0.15);
    color: #ffb3b3;
}

.dark .coming-soon {
    background: #2d2d2d;
    color: #ffe082;
}

.dark .content a {
    color: #7bb6ff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

h1 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--secondary-text);
    font-size: 20px;
}

.platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.platform-card {
    flex: 1 1 320px;
    max-width: 370px;
    background: var(--card-background);
    border-radius: 16px;
    padding: 16px 14px 12px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: box-shadow 0.3s, transform 0.3s;
    opacity: 0;
    transform: translateY(30px);
    animation: cardIn 0.7s cubic-bezier(.4,2,.3,1) forwards;
    min-height: unset;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transform: translateY(-6px) scale(1.02);
}

.platform-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.platform-icon {
    font-size: 24px;
    margin-right: 10px;
}

h2 {
    font-size: 24px;
    font-weight: 500;
}

.content {
    min-height: unset;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.content p {
    color: var(--secondary-text);
    font-size: 14px;
}

.content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.content a:hover {
    opacity: 0.8;
}

.media-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
}

.media-container img,
.media-container video {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 220px;
    border-radius: 8px;
}

.stats {
    display: flex;
    gap: 15px;
    color: var(--secondary-text);
    font-size: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.loading {
    color: var(--secondary-text);
    text-align: center;
    padding: 20px;
    position: relative;
    min-height: 40px;
}

.skeleton {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    background: linear-gradient(90deg, #ececec 25%, #f3f3f3 50%, #ececec 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.error-message {
    color: #ff3b30;
    text-align: center;
    padding: 20px;
    background: rgba(255, 59, 48, 0.13);
    border-radius: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-message::before {
    content: '⚠️';
    font-size: 20px;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--secondary-text);
    font-size: 14px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .platforms {
        flex-direction: column;
        gap: 6px;
    }
    .platform-card {
        max-width: 100%;
    }
    .category-tabs {
        flex-wrap: wrap;
        gap: 5px;
        margin: 18px 0 10px 0;
    }
}

@media (max-width: 900px) {
    .platform-card { min-width: 320px; max-width: 98vw; margin: 0 auto 18px auto; }
    .platforms { gap: 18px; }
}
@media (max-width: 600px) {
    .platform-card { min-width: 98vw; max-width: 99vw; margin: 0 auto 22px auto; }
    .platforms { gap: 22px; }
}

.audio-container {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
}

.audio-container audio {
    width: 100%;
    height: 40px;
}

.audio-container audio::-webkit-media-controls-panel {
    background-color: #f8f8f8;
}

.audio-container audio::-webkit-media-controls-play-button {
    background-color: var(--accent-color);
    border-radius: 50%;
}

.audio-container audio::-webkit-media-controls-current-time-display,
.audio-container audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-color);
}

.coming-soon {
    margin-top: 20px;
    padding: 12px;
    background: #fffbe6;
    color: #b26a00;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

#darkmode-toggle {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 17px;
    padding: 7px 18px;
    margin-left: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
#darkmode-toggle:hover {
    background: var(--accent-color);
    color: #fff;
    border: 1.5px solid var(--accent-color);
}
.dark #darkmode-toggle {
    background: #232326;
    color: #f5f5f7;
    border: 1.5px solid #444;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 0;
}

.widget-modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.widget-modal-content {
    background: #fff;
    color: #1d1d1f;
    padding: 32px 24px 24px 24px;
    border-radius: 12px;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    position: relative;
}
.widget-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    cursor: pointer;
    color: #86868b;
}
#widget-btn {
    margin-top: 18px;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
#widget-btn:hover {
    background: #005bb5;
}
.dark .widget-modal-content {
    background: #232326;
    color: #f5f5f7;
}

.share-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 15px;
    margin-top: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
}
.share-btn:hover {
    background: #005bb5;
}
.share-copied {
    display: inline-block;
    margin-left: 10px;
    color: #0071e3;
    font-size: 14px;
    font-weight: 500;
    background: #e6f4ff;
    border-radius: 6px;
    padding: 2px 8px;
    animation: fadeOut 2s forwards;
}
@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

#search-bar {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 16px;
    margin-right: 12px;
    min-width: 180px;
    outline: none;
    transition: border 0.2s;
}
#search-bar:focus {
    border: 1.5px solid var(--accent-color);
}
.dark #search-bar {
    background: #232326;
    color: #f5f5f7;
    border: 1px solid #444;
}

.views-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #b0b0b5;
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: -4px;
    justify-content: flex-end;
}
.dark .views-counter {
    color: #888;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
    margin-bottom: 24px;
}
.category-tab {
    background: #f5f5f7;
    color: #1d1d1f;
    border: none;
    border-radius: 18px 18px 0 0;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    outline: none;
    border-bottom: 2.5px solid transparent;
}
.category-tab.active, .category-tab:hover {
    background: var(--accent-color);
    color: #fff;
    border-bottom: 2.5px solid var(--accent-color);
}
.dark .category-tab {
    background: #232326;
    color: #f5f5f7;
}
.dark .category-tab.active, .dark .category-tab:hover {
    background: #0071e3;
    color: #fff;
    border-bottom: 2.5px solid #0071e3;
}

.card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.platform-card ul, .platform-card li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.card-hidden { display: none !important; }

.dark .platform-card button, .dark .share-btn {
    background: #2196f3;
    color: #fff;
    border: none;
}
.dark .platform-card button:hover, .dark .share-btn:hover {
    background: #42a5f5;
}

.new-badge {
    display: inline-block;
    background: #ff9800;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 8px;
    padding: 2px 8px;
    margin-left: 8px;
    vertical-align: middle;
    animation: newBadgePulse 1.2s infinite alternate;
}
@keyframes newBadgePulse {
    0% { box-shadow: 0 0 0 0 #ff980044; }
    100% { box-shadow: 0 0 8px 4px #ff980044; }
}

.share-btn.pulse {
    animation: sharePulse 0.7s;
}
@keyframes sharePulse {
    0% { background: #2196f3; }
    50% { background: #43e97b; color: #fff; transform: scale(1.08); }
    100% { background: #2196f3; }
}

#global-spinner {
  transition: opacity 0.5s;
  background: rgba(255,255,255,0.6) !important;
  backdrop-filter: blur(2px);
}
#global-spinner.hide {
  opacity: 0;
  pointer-events: none;
}
.lds-dual-ring {
  width: 48px;
  height: 48px;
}
.lds-dual-ring:after {
  content: " ";
  display: block;
  width: 34px;
  height: 34px;
  margin: 1px;
  border-radius: 50%;
  border: 5px solid #0071e3;
  border-color: #0071e3 transparent #0071e3 transparent;
  animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}
.dark #global-spinner {
  background: rgba(24,24,26,0.85);
}

/* Sidebar layout */
.app-layout {
  padding-top: 0;
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 32px 0 0 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}
.sidebar-logo {
  font-size: 24px;
  font-weight: 700;
  color: #0071e3;
  margin-left: 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-left: 16px;
}
.sidebar-link {
  background: none;
  border: none;
  color: #1d1d1f;
  font-size: 17px;
  text-align: left;
  padding: 10px 0 10px 28px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  width: calc(100% - 12px);
  display: block;
  margin: 0 6px 4px 0;
  font-weight: 400;
}
.sidebar-link.active {
  font-weight: 600;
  background: #e3e8f0;
  color: #0071e3;
}
.sidebar-link:hover {
  background: #e3e8f0;
  color: #0071e3;
}
.dark .sidebar {
  background: #181c22;
  box-shadow: 2px 0 8px rgba(0,0,0,0.18);
}
.dark .sidebar-logo {
  color: #42a5f5;
}
.dark .sidebar-link {
  color: #f5f5f7;
  background: none;
}
.dark .sidebar-link.active, .dark .sidebar-link:hover {
  background: #23272f;
  color: #42a5f5;
}
.main-content {
  flex: 1;
  padding-left: 0;
  min-width: 0;
}
@media (min-width: 900px) {
  .main-content {
    padding-left: 32px;
  }
}
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .main-content {
    padding-left: 0;
  }
}

.dark #history-view li {
  background: #23272f !important;
  color: #f5f5f7 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18) !important;
}
.dark #history-view h2 {
  color: #f5f5f7 !important;
}
.dark #history-view a {
  color: #42a5f5 !important;
}
.dark #history-view div {
  color: #b0b0b5 !important;
}

/* --- Styl dla sekcji top-widgets (cytat, fakt, krypto, news) --- */
#top-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  align-items: stretch;
  margin: 0;
  padding: 0;
}
#top-widgets > div {
  background: #fff;
  color: #232326;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0001;
  padding: 14px 16px 14px 16px;
  min-width: 250px;
  max-width: 270px;
  height: 190px;
  font-size: 0.97em;
  overflow-y: unset;
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  text-align: left;
  box-sizing: border-box;
}
#top-widgets > div > b {
  color: #232326;
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  #top-widgets { flex-direction: column; align-items: stretch; }
  #top-widgets > div { max-width: 100%; min-width: 0; }
}

.top-widget-card {
  background: #232326;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0002;
  padding: 12px 14px 10px 14px;
  color: #fff;
  font-size: 0.98em;
  min-width: 160px;
  max-width: 210px;
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  margin: 0;
  text-align: left;
  height: auto;
  box-sizing: border-box;
}
.top-widget-card b {
  font-size: 1.08em;
  font-weight: 600;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.breaking-news-marquee {
  display: flex;
  align-items: center;
  height: 32px;
  overflow: hidden;
  position: relative;
  width: 100%;
  white-space: nowrap;
}
.breaking-news-marquee .marquee-inner {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 18s linear infinite;
  white-space: nowrap;
}
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Pasek breaking news na całą szerokość */
#breaking-news-bar {
  display: none;
  width: 100vw;
  min-width: 0;
  max-width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  background: #fff;
  color: #232326;
  align-items: center;
  font-size: 1em;
  font-weight: 600;
  box-shadow: 0 2px 12px #0001;
  height: 36px;
  padding: 0 18px;
  gap: 16px;
}
body.has-breaking-news #breaking-news-bar {
  display: flex;
}
.breaking-news-label {
  color: #ff9800;
  margin-right: 18px;
  white-space: nowrap;
}
.breaking-news-marquee, .marquee-inner {
  color: #ffd600;
  font-weight: 600;
}
.dark #breaking-news-bar {
  background: #232326;
  color: #ffd600;
  box-shadow: 0 2px 12px #0002;
}
.dark .breaking-news-label {
  color: #ff9800;
}
.dark .breaking-news-marquee, .dark .marquee-inner {
  color: #ffd600;
}

/* Dla responsywności */
@media (max-width: 768px) {
  #breaking-news-bar {
    font-size: 0.92em;
    height: 32px;
    padding: 0 8px;
    gap: 8px;
  }
  .breaking-news-label {
    margin-right: 8px;
  }
}

/* Dodam osobno styl dla body.has-breaking-news .app-layout niżej */
body.has-breaking-news .app-layout {
  padding-top: 40px;
}

.dark #top-widgets > div {
  background: #232326;
  color: #fff;
  box-shadow: 0 2px 12px #0002;
}
.dark #top-widgets > div > b {
  color: #fff;
} 