/* Reset CSS minimale in stile 2005 */
* {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
    font-size: 11px;
    background: #f8f8f8;
    color: #333;
    line-height: 1.4;
}

/* Header - colori tipici RTM */
#header {
    background: #4a90e2 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChAGA60e6kgAAAABJRU5ErkJggg==) repeat-x;
    border-bottom: 1px solid #2171b5;
    height: 60px;
    position: relative;
}

#header-content {
    width: 95%;
    margin: 0 auto;
    position: relative;
    height: 60px;
}

#logo-container {
    position: absolute;
    top: 8px;
    left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

#rtm-logo {
    height: 28px;
    width: auto;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

#rtm-logo:hover {
    transform: scale(1.05);
    animation: rtmGlow 0.8s ease-in-out;
}

@keyframes rtmGlow {
    0%, 100% { filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3)); }
    50% { filter: drop-shadow(0 0 8px rgba(74, 144, 226, 0.8)); }
}

#logo {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    margin: 0;
}

#logo:hover {
    color: #ffd700;
}

#tagline {
    color: #b8d4f0;
    font-size: 10px;
    position: absolute;
    top: 35px;
    left: 0;
}

/* Navigation */
#nav {
    background: #e8f4fd;
    border-bottom: 1px solid #c5e0f7;
    height: 28px;
    position: relative;
}

#nav ul {
    width: 95%;
    margin: 0 auto;
    list-style: none;
    height: 28px;
}

#nav li {
    float: left;
    margin-right: 1px;
}

#nav a {
    display: block;
    padding: 8px 12px 7px 12px;
    text-decoration: none;
    color: #4a90e2;
    background: transparent;
    border-right: 1px solid #d1e5f8;
    font-size: 11px;
    font-weight: bold;
}

#nav a:hover {
    background: #ffffff;
    color: #2171b5;
}

/* Container principale */
#container {
    width: 95%;
    margin: 0 auto;
    padding-top: 15px;
    position: relative;
    min-height: 500px;
}

/* Sidebar */
#sidebar {
    width: 200px;
    float: left;
    margin-right: 15px;
}

.sidebar-box {
    background: white;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    padding: 10px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e8f4fd;
    padding-bottom: 3px;
}

.sidebar-rtm-logo {
    height: 16px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-box h3 {
    color: #4a90e2;
    font-size: 12px;
    margin: 0;
}

.sidebar-box p {
    font-size: 10px;
    line-height: 1.3;
}

.sidebar-box ul {
    font-size: 10px;
    margin-left: 15px;
}

.sidebar-box li {
    margin-bottom: 2px;
}

/* Content principale */
#content {
    margin-left: 230px;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 15px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    min-height: 400px;
}

.content-section {
    display: block;
}

h2 {
    color: #4a90e2;
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e8f4fd;
    padding-bottom: 5px;
}

h3 {
    color: #4a90e2;
    font-size: 13px;
    margin: 15px 0 8px 0;
}

h4 {
    color: #333;
    font-size: 12px;
    margin: 10px 0 5px 0;
    font-weight: bold;
}

p {
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Blockquotes */
blockquote {
    background: #fafafa;
    border-left: 3px solid #4a90e2;
    padding: 10px 15px;
    margin: 15px 0;
    font-style: italic;
}

cite {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: #666;
    text-align: right;
}

/* Timeline */
.timeline {
    margin-top: 15px;
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
    padding-left: 80px;
    border-left: 2px solid #e8f4fd;
}

.timeline-date {
    position: absolute;
    left: -70px;
    top: 0;
    background: #4a90e2;
    color: white;
    padding: 3px 8px;
    font-weight: bold;
    font-size: 10px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    width: 40px;
    text-align: center;
}

.timeline-content {
    background: #fafafa;
    padding: 10px;
    border: 1px solid #e0e0e0;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

/* Technique Grid */
.technique-grid {
    display: block;
    margin: 15px 0;
}

.technique-box {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 10px;
    margin-bottom: 10px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    width: 45%;
    float: left;
    margin-right: 10px;
}

.technique-box:nth-child(even) {
    margin-right: 0;
}

/* Clearfix per la grid */
.technique-grid:after {
    content: "";
    display: table;
    clear: both;
}

/* AJAX Demo Styles */
#ajax-demo {
    background: #f0f7ff;
    border: 2px solid #4a90e2;
    padding: 15px;
    margin: 15px 0;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

#demo-header {
    border-bottom: 1px solid #4a90e2;
    padding-bottom: 8px;
    margin-bottom: 15px;
    position: relative;
}

#demo-header h3 {
    color: #4a90e2;
    margin: 0;
    display: inline-block;
}

#demo-status {
    position: absolute;
    right: 0;
    top: 0;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

#demo-add-task {
    margin-bottom: 15px;
}

#new-task-input {
    width: 250px;
    padding: 4px;
    border: 1px solid #ccc;
    font-size: 11px;
    margin-right: 5px;
}

#add-task-btn {
    padding: 4px 12px;
    background: #ff9500;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

#add-task-btn:hover {
    background: #ff7700;
}

/* Demo Tasks */
.demo-task {
    background: white;
    border: 1px solid #ddd;
    padding: 8px;
    margin-bottom: 5px;
    position: relative;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    cursor: move;
}

.demo-task:hover {
    background: #f8f8f8;
    border-color: #4a90e2;
}

.demo-task input[type="checkbox"] {
    margin-right: 8px;
}

.task-text {
    cursor: pointer;
}

.task-text:hover {
    text-decoration: underline;
}

.delete-task {
    position: absolute;
    right: 8px;
    top: 8px;
    color: #ff4444;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.delete-task:hover {
    color: #ff0000;
}

.task-completed .task-text {
    text-decoration: line-through;
    color: #999;
}

/* AJAX Log */
#demo-log {
    margin-top: 15px;
    border-top: 1px solid #4a90e2;
    padding-top: 10px;
}

#ajax-log {
    background: white;
    border: 1px solid #ddd;
    padding: 8px;
    height: 100px;
    overflow-y: scroll;
    font-family: "Courier New", monospace;
    font-size: 10px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

.ajax-log-entry {
    color: #666;
    margin-bottom: 3px;
}

.ajax-log-entry.success {
    color: #28a745;
}

.ajax-log-entry.error {
    color: #dc3545;
}

/* Code Explanation */
.code-explanation {
    margin-top: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 15px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

pre {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px;
    overflow-x: auto;
    font-family: "Courier New", Monaco, monospace;
    font-size: 10px;
    line-height: 1.3;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    margin: 10px 0;
}

code {
    font-family: "Courier New", Monaco, monospace;
    font-size: 10px;
}

/* Footer */
#footer {
    clear: both;
    width: 95%;
    margin: 30px auto 0 auto;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 10px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-main {
    flex: 1;
    text-align: left;
}

.footer-main p {
    margin-bottom: 5px;
}

.footer-credit {
    text-align: right;
    flex-shrink: 0;
}

.footer-credit p {
    margin-bottom: 2px;
    font-weight: bold;
}

.footer-credit small {
    font-size: 8px;
    color: #999;
    font-style: italic;
}

.applikat-link {
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.applikat-link:hover {
    color: #ff9500;
    text-decoration: underline;
}

/* === BLOG SECTION === */

.blog-intro {
    background: #f0f7ff;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e8f4fd;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

.blog-intro p {
    margin: 0;
    font-style: italic;
    color: #4a90e2;
}

.blog-posts {
    margin-bottom: 25px;
}

.blog-post {
    background: white;
    border: 1px solid #e0e0e0;
    margin-bottom: 25px;
    padding: 20px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blog-post:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

.blog-post-header {
    border-bottom: 1px solid #e8f4fd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.blog-post-header h3 {
    color: #4a90e2;
    font-size: 16px;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.blog-post-date {
    color: #666;
    font-size: 10px;
    font-weight: bold;
}

.blog-post-meta {
    font-size: 9px;
    color: #999;
    margin-top: 3px;
}

.blog-post-meta .author {
    color: #4a90e2;
    font-weight: bold;
}

.blog-post-content {
    line-height: 1.5;
}

.blog-post-content h4 {
    color: #4a90e2;
    font-size: 12px;
    margin: 15px 0 8px 0;
    border-left: 3px solid #ff9500;
    padding-left: 8px;
}

.blog-post-content ul {
    margin: 10px 0 10px 20px;
}

.blog-post-content li {
    margin-bottom: 5px;
    font-size: 11px;
    line-height: 1.4;
}

.blog-quote {
    background: #fafafa;
    border-left: 4px solid #4a90e2;
    padding: 12px 15px;
    margin: 15px 0;
    font-style: italic;
    color: #555;
    font-size: 11px;
}

.blog-post-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 15px;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background: #e8f4fd;
    color: #4a90e2;
    padding: 2px 6px;
    font-size: 8px;
    font-weight: bold;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag:hover {
    background: #4a90e2;
    color: white;
    cursor: default;
}

.blog-cta {
    background: linear-gradient(135deg, #4a90e2 0%, #ff9500 100%);
    color: white;
    padding: 20px;
    text-align: center;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
    border-radius: 8px;
    margin-top: 25px;
}

.blog-cta h3 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.blog-cta p {
    margin: 0 0 15px 0;
    font-size: 11px;
    opacity: 0.9;
}

.cta-button {
    background: white;
    color: #4a90e2;
    border: none;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cta-button:active {
    transform: translateY(0);
}

/* Animazioni e transizioni in stile 2005 */
.fade-in {
    -moz-opacity: 0;
    opacity: 0;
    filter: alpha(opacity=0);
}

.fade-in-complete {
    -moz-opacity: 1;
    opacity: 1;
    filter: alpha(opacity=100);
}

/* Supporto per IE6 */
* html #container {
    height: 500px;
}

* html .sidebar-box {
    height: 1%;
}

/* Clearfix vecchia scuola */
.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

* html .clearfix {
    height: 1%;
}

/* Hover effects tipici dell'epoca */
a:link { color: #4a90e2; }
a:visited { color: #6b5b95; }
a:hover { color: #ff9500; }
a:active { color: #ff7700; }

/* Input focus effects */
input:focus {
    border-color: #4a90e2;
    background: #f0f7ff;
}

/* Button styles */
button {
    font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
}

button:active {
    position: relative;
    top: 1px;
}

/* Status indicators */
.status-loading {
    background: #ffc107 !important;
    color: black !important;
}

.status-error {
    background: #dc3545 !important;
    color: white !important;
}

.status-success {
    background: #28a745 !important;
    color: white !important;
}

/* Accessibility - Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }
    
    #header {
        background: #000;
        border-color: #fff;
    }
    
    #content, .sidebar-box {
        background: #000;
        border-color: #fff;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-complete {
        transition: none !important;
        animation: none !important;
    }
}

/* === RESPONSIVE DESIGN === */

/* Tablet breakpoint */
@media screen and (max-width: 768px) {
    body {
        font-size: 12px;
    }
    
    #header-content {
        width: 98%;
    }
    
    #logo {
        font-size: 16px;
    }
    
    #tagline {
        font-size: 9px;
    }
    
    #nav ul {
        width: 98%;
    }
    
    #nav a {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    #container {
        width: 98%;
    }
    
    #content {
        margin-left: 180px;
        padding: 12px;
    }
    
    #sidebar {
        width: 160px;
        margin-right: 12px;
    }
    
    .sidebar-box {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .sidebar-box h3 {
        font-size: 11px;
    }
    
    .sidebar-box p,
    .sidebar-box ul {
        font-size: 9px;
    }
    
    h2 {
        font-size: 14px;
    }
    
    #ajax-demo {
        padding: 12px;
    }
    
    #new-task-input {
        width: 180px;
    }
}

/* Mobile breakpoint */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    #header {
        height: auto;
        padding: 10px 0;
        text-align: center;
    }
    
    #header-content {
        width: 95%;
        position: static;
        text-align: center;
    }
    
    #logo-container {
        position: static;
        justify-content: center;
        margin-bottom: 5px;
    }
    
    #rtm-logo {
        height: 24px;
        width: auto;
    }
    
    #logo {
        font-size: 18px;
        margin: 0;
    }
    
    #tagline {
        position: static;
        font-size: 11px;
    }
    
    /* Mobile Navigation */
    #nav {
        background: #d1e5f8;
        text-align: center;
        padding: 8px 0;
    }
    
    #nav ul {
        width: 95%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }
    
    #nav li {
        flex: 1;
        min-width: calc(50% - 1px);
        margin: 1px;
    }
    
    #nav a {
        padding: 8px 4px;
        font-size: 12px;
        font-weight: bold;
        text-align: center;
        border: 1px solid #c5e0f7;
        border-radius: 3px;
        background: #f0f7ff;
        display: block;
        margin: 0;
    }
    
    #nav a:hover {
        background: #ffffff;
        transform: scale(0.98);
    }
    
    /* Mobile Layout - Stack sidebar below content */
    #container {
        width: 95%;
        padding-top: 10px;
    }
    
    #content {
        margin-left: 0;
        margin-bottom: 15px;
        padding: 12px;
        order: 1;
    }
    
    #sidebar {
        width: 100%;
        float: none;
        margin-right: 0;
        order: 2;
    }
    
    .sidebar-box {
        margin-bottom: 10px;
        padding: 10px;
    }
    
    /* Mobile Typography */
    h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    h3 {
        font-size: 14px;
    }
    
    h4 {
        font-size: 13px;
    }
    
    p {
        margin-bottom: 12px;
        line-height: 1.5;
    }
    
    /* Mobile Timeline */
    .timeline-item {
        padding-left: 60px;
        margin-bottom: 15px;
    }
    
    .timeline-date {
        left: -50px;
        width: 35px;
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .timeline-content {
        padding: 8px;
    }
    
    /* Mobile Technique Grid */
    .technique-box {
        width: 100%;
        float: none;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    /* Mobile AJAX Demo */
    #ajax-demo {
        padding: 10px;
        margin: 10px 0;
    }
    
    #demo-header {
        flex-direction: column;
        text-align: center;
    }
    
    #demo-status {
        position: static;
        margin-top: 5px;
        display: inline-block;
    }
    
    #new-task-input {
        width: calc(100% - 80px);
        margin-bottom: 8px;
        display: block;
    }
    
    #add-task-btn {
        width: 70px;
        float: right;
    }
    
    .demo-task {
        padding: 10px 8px;
        margin-bottom: 8px;
    }
    
    .task-text {
        display: block;
        margin: 5px 0;
        word-wrap: break-word;
    }
    
    .delete-task {
        right: 5px;
        top: 5px;
        padding: 5px;
    }
    
    #ajax-log {
        height: 80px;
        font-size: 9px;
    }
    
    /* Mobile Code Block */
    pre {
        font-size: 9px;
        overflow-x: auto;
        white-space: pre-wrap;
    }
    
    /* Mobile Footer */
    #footer {
        width: 95%;
        padding: 10px 0;
        font-size: 9px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .footer-main {
        text-align: center;
    }
    
    .footer-credit {
        text-align: center;
    }
    
    /* Mobile Blog */
    .blog-post {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .blog-post-header h3 {
        font-size: 14px;
    }
    
    .blog-post-date {
        font-size: 9px;
    }
    
    .blog-post-meta {
        font-size: 8px;
    }
    
    .blog-post-content h4 {
        font-size: 11px;
    }
    
    .blog-post-content li {
        font-size: 10px;
    }
    
    .blog-quote {
        padding: 10px 12px;
        font-size: 10px;
    }
    
    .blog-tags {
        gap: 3px;
    }
    
    .tag {
        font-size: 7px;
        padding: 1px 4px;
    }
    
    .blog-cta {
        padding: 15px;
    }
    
    .blog-cta h3 {
        font-size: 13px;
    }
    
    .blog-cta p {
        font-size: 10px;
    }
    
    .cta-button {
        font-size: 11px;
        padding: 8px 16px;
    }
}

/* Large mobile / small tablet (landscape) */
@media screen and (max-width: 640px) and (orientation: landscape) {
    #nav li {
        min-width: calc(25% - 1px);
    }
    
    #content {
        margin-left: 0;
    }
    
    #sidebar {
        width: 100%;
        float: none;
    }
}
