/*
Theme Name: MacOS Theme
Theme URI: https://example.com/macos-theme
Author: AI Assistant
Description: Тема в стиле macOS Desktop с галереей, календарём и музыкой
Version: 5.0
Requires at least: 6.0
Tested up to: 6.9.4
*/

:root {
    --bg-color: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --window-bg: rgba(255, 255, 255, 0.90);
    --window-dark: rgba(30, 30, 30, 0.9);
    --text-color: #000000;
    --text-light: #ffffff;
    --accent: #007aff;
    --dock-bg: rgba(255, 255, 255, 0.2);
    --quicktime-bg: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-100px) rotate(180deg); opacity: 0.8; }
}

.top-bar {
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 13px;
    color: #fff;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.top-bar-left, .top-bar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.desktop {
    padding-top: 40px;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 1;
}

.window {
    position: absolute;
    background: var(--window-bg);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 300px;
    min-height: 200px;
    resize: both;
    max-width: 90vw;
    max-height: 80vh;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.window.minimized {
    transform: scale(0.1) translateY(500px);
    opacity: 0;
    pointer-events: none;
}

.window.dark {
    background: var(--window-dark);
    color: var(--text-light);
    font-family: "Menlo", "Consolas", monospace;
    font-size: 12px;
}

.window-header {
    height: 38px;
    background: rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.window.dark .window-header {
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
}

.traffic-lights {
    display: flex;
    gap: 6px;
    margin-right: 10px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.light.red:hover { background: #ff3b30; }
.light.yellow:hover { background: #ff9500; }
.light.green:hover { background: #34c759; }

.window-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.window.blog-window {
    width: 50%;
    height: 60%;
    left: 25%;
    top: 15%;
    z-index: 10;
}

.window.about-window {
    width: 400px;
    height: 500px;
    display: none;
}
.window.about-window.active {
    display: flex;
}

.chat-message {
    background: #fff;
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 14px;
}
.chat-message.author {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
}
.chat-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 4px;
    display: block;
}
.chat-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.chat-image:hover {
    transform: scale(1.02);
}

.notepad-content {
    font-family: "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: se-resize;
    z-index: 100;
}

.window.mail-window {
    width: 400px;
    height: 500px;
    display: none;
}
.window.mail-window.active {
    display: flex;
}
.mail-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mail-form input, .mail-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255,255,255,0.5);
    box-sizing: border-box;
}
.mail-form input:required, .mail-form textarea:required {
    border-left: 3px solid var(--accent);
}
.mail-form textarea {
    height: 150px;
    resize: vertical;
}
.mail-form button {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.mail-form button:hover {
    background: #0056b3;
}
.file-upload {
    border: 2px dashed rgba(0,0,0,0.2);
    padding: 20px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.file-upload:hover {
    background: rgba(0,0,0,0.05);
}
.file-upload input {
    display: none;
}
.file-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* QuickTime Player Style */
.window.music-player {
    width: 450px;
    height: 180px;
    display: none;
    background: var(--quicktime-bg);
    border: 1px solid #999;
    border-radius: 5px;
}
.window.music-player.active {
    display: flex;
}
.window.music-player .window-header {
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
    border-bottom: 1px solid #999;
    color: #333;
}
.music-player-content {
    display: flex;
    flex-direction: column;
    padding: 10px;
    flex: 1;
}
.music-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
.music-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}
.music-details {
    flex: 1;
}
.music-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.music-artist {
    font-size: 12px;
    color: #666;
}
.music-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #d0d0d0;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #999;
}
.music-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid #999;
    background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
    color: #333;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.music-btn:hover {
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
    border-color: #666;
}
.music-btn.play {
    width: 45px;
    height: 45px;
    font-size: 18px;
}
.music-progress {
    flex: 1;
    height: 6px;
    background: #999;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}
.music-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}
.music-time {
    font-size: 11px;
    color: #666;
    min-width: 80px;
    text-align: right;
}

/* Gallery Window */
.window.gallery-window {
    width: 700px;
    height: 550px;
    display: none;
}
.window.gallery-window.active {
    display: flex;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}
.gallery-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    background: #fff;
}
.gallery-item:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

/* Calendar Window */
.window.calendar-window {
    width: 400px;
    height: 500px;
    display: none;
}
.window.calendar-window.active {
    display: flex;
}
.calendar-header {
    text-align: center;
    padding: 15px;
    background: rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 16px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: 15px;
}
.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    padding: 5px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(255,255,255,0.5);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.calendar-day:hover {
    background: rgba(0,122,255,0.2);
}
.calendar-day.has-posts {
    background: rgba(0,122,255,0.3);
    color: #fff;
}
.calendar-day .post-count {
    font-size: 9px;
    opacity: 0.8;
}
.calendar-day.today {
    border: 2px solid var(--accent);
}
.calendar-day.empty {
    background: transparent;
    cursor: default;
}
.calendar-list {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}
.calendar-post-item {
    padding: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background 0.2s;
}
.calendar-post-item:hover {
    background: rgba(0,122,255,0.1);
}
.calendar-post-date {
    font-size: 12px;
    color: #666;
}
.calendar-post-title {
    font-size: 14px;
    font-weight: 500;
    margin-top: 3px;
}

.dock-container {
    position: fixed;
    bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
}
.dock {
    background: var(--dock-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 8px 15px;
    display: flex;
    gap: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    pointer-events: auto;
}
.dock-item {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.dock-item:hover {
    transform: scale(1.2) translateY(-10px);
}
.dock-item.inactive {
    opacity: 0.5;
    cursor: not-allowed;
}
.dock-item.inactive:hover {
    transform: none;
}

.window.active {
    z-index: 100;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.window-content::-webkit-scrollbar { width: 8px; }
.window-content::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
.window-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 4px; }
.window-content::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.5); }

.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
    display: none;
}

@media (max-width: 768px) {
    .window.blog-window { width: 90%; height: 50%; left: 5%; top: 10%; }
    .window { min-width: 280px; min-height: 150px; }
    .dock-item { width: 40px; height: 40px; font-size: 20px; }
    .window.mail-window, .window.music-player, .window.about-window, .window.gallery-window, .window.calendar-window { width: 90%; left: 5% !important; }
}