/**
 * PassGram v3.0 - OS/2 Warp 3.0 Theme
 *
 * Authentic OS/2 Warp 3.0 user interface styling with purple title bars,
 * 3D beveled borders, and classic system gray backgrounds.
 */

/* ========== RESET & TYPOGRAPHY ========== */

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

body {
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-size: 12px;
    background: #008080; /* OS/2 Desktop teal */
    color: #000000;
    padding: 20px;
}

/* ========== OS/2 WINDOW CONTAINER ========== */

.window {
    background: #C0C0C0; /* Classic dialog gray */
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.window-large {
    max-width: 900px;
    margin: 0 auto 20px auto;
}

.window-medium {
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.window-small {
    max-width: 400px;
    margin: 0 auto 20px auto;
}

/* ========== TITLE BAR (Purple OS/2 Warp) ========== */

.title-bar {
    background: linear-gradient(180deg, #7B00B4 0%, #5D009D 50%, #4A007A 100%);
    color: #FFFFFF;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 13px;
    border-bottom: 2px solid #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-text {
    flex: 1;
}

.title-bar-controls {
    display: flex;
    gap: 4px;
}

.title-bar-button {
    width: 16px;
    height: 14px;
    background: #C0C0C0;
    border-top: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    font-size: 10px;
    text-align: center;
    line-height: 12px;
    cursor: pointer;
    color: #000;
}

.title-bar-button:active {
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    border-right: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
}

/* ========== WINDOW CONTENT ========== */

.window-body {
    padding: 15px;
}

/* ========== BUTTONS ========== */

.button,
button,
input[type="submit"],
input[type="button"] {
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 4px 12px;
    min-width: 75px;
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    color: #000000;
    outline: none;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background: #D4D0C8;
}

.button:active,
button:active,
input[type="submit"]:active {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    padding: 5px 11px 3px 13px; /* Shift content on press */
}

.button:disabled {
    color: #808080;
    cursor: not-allowed;
}

.button-primary {
    border: 3px solid #000000;
}

/* ========== FORM ELEMENTS ========== */

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 3px 4px;
    background: #FFFFFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #000000;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: 1px dotted #000000;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    height: 24px;
    font-family: 'Helvetica', 'Arial', sans-serif;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 6px;
}

.field-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.field-row label {
    flex: 0 0 120px;
}

.field-row-stacked {
    display: flex;
    flex-direction: column;
}

/* ========== SUNKEN PANELS ========== */

.panel {
    background: #FFFFFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    padding: 10px;
    margin-bottom: 10px;
}

.panel-gray {
    background: #C0C0C0;
}

/* ========== TABS ========== */

.tabs {
    display: flex;
    margin-bottom: -2px;
    gap: 2px;
}

.tab {
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    padding: 4px 12px;
    cursor: pointer;
    font-weight: bold;
}

.tab.active {
    background: #DFDFDF;
    border-bottom: 2px solid #DFDFDF;
}

.tab:not(.active):hover {
    background: #D4D0C8;
}

.tab-content {
    display: none;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 15px;
    background: #DFDFDF;
}

.tab-content.active {
    display: block;
}

/* ========== MENU BAR ========== */

.menu-bar {
    background: #C0C0C0;
    border-bottom: 2px solid #808080;
    padding: 2px;
    margin-bottom: 10px;
}

.menu-bar ul {
    list-style: none;
    display: flex;
    gap: 0;
}

.menu-bar li {
    position: relative;
}

.menu-bar a {
    display: block;
    padding: 4px 8px;
    color: #000000;
    text-decoration: none;
    font-weight: normal;
}

.menu-bar a:hover {
    background: #000080;
    color: #FFFFFF;
}

.menu-bar .disabled {
    color: #808080;
    cursor: not-allowed;
}

/* ========== STATUS BAR ========== */

.status-bar {
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    padding: 4px 8px;
    display: flex;
    gap: 10px;
    font-size: 11px;
}

.status-bar-field {
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
    padding: 2px 6px;
    background: #DFDFDF;
}

/* ========== TABLES (List View) ========== */

table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
}

thead {
    background: #C0C0C0;
}

th {
    padding: 4px 8px;
    text-align: left;
    font-weight: bold;
    border-right: 1px solid #808080;
    border-bottom: 2px solid #808080;
}

th:last-child {
    border-right: none;
}

td {
    padding: 4px 8px;
    border-right: 1px solid #DFDFDF;
    border-bottom: 1px solid #DFDFDF;
}

td:last-child {
    border-right: none;
}

tr:hover {
    background: #000080;
    color: #FFFFFF;
}

tr.selected {
    background: #000080;
    color: #FFFFFF;
}

/* ========== ALERTS & MESSAGES ========== */

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid;
}

.alert-info {
    background: #FFFF00;
    border-color: #808000;
    color: #000000;
}

.alert-success {
    background: #00FF00;
    border-color: #008000;
    color: #000000;
}

.alert-error {
    background: #FF0000;
    border-color: #800000;
    color: #FFFFFF;
}

.alert-warning {
    background: #FFA500;
    border-color: #804000;
    color: #000000;
}

/* ========== GROUPBOX / FIELDSET ========== */

fieldset {
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 10px;
    margin-bottom: 15px;
}

legend {
    background: #C0C0C0;
    padding: 2px 8px;
    font-weight: bold;
}

/* ========== SCROLLBAR (webkit) ========== */

::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #DFDFDF;
}

::-webkit-scrollbar-thumb {
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
}

::-webkit-scrollbar-button {
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
}

::-webkit-scrollbar-button:active {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
}

/* ========== UTILITY CLASSES ========== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

.p-10 {
    padding: 10px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* ========== MONOSPACE TEXT (for codes, passwords) ========== */

.monospace {
    font-family: 'Courier New', Courier, monospace;
    background: #000000;
    color: #00FF00;
    padding: 8px;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    word-break: break-all;
}

code {
    background: #DFDFDF;
    padding: 2px 4px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #808080;
}

pre {
    background: #FFFFFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

/* ========== LINKS ========== */

a {
    color: #0000FF;
    text-decoration: underline;
}

a:visited {
    color: #800080;
}

a:hover {
    color: #FF0000;
}

a:active {
    color: #FF0000;
}

/* ========== PROGRESS BAR ========== */

.progress-bar {
    background: #FFFFFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    height: 20px;
    position: relative;
}

.progress-bar-fill {
    background: #000080;
    height: 100%;
    transition: width 0.3s;
}

/* ========== TREE VIEW ========== */

.tree {
    list-style: none;
    padding-left: 0;
}

.tree li {
    padding-left: 20px;
    position: relative;
}

.tree li:before {
    content: "├─";
    position: absolute;
    left: 0;
}

.tree li:last-child:before {
    content: "└─";
}

/* ========== ICON GRID (for password entries) ========== */

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 10px;
}

.icon-item {
    text-align: center;
    cursor: pointer;
    padding: 8px;
}

.icon-item:hover {
    background: #000080;
    color: #FFFFFF;
}

.icon-image {
    width: 32px;
    height: 32px;
    margin: 0 auto 5px;
    background: #C0C0C0;
    border: 1px solid #808080;
}

/* ========== HEADER STYLES ========== */

h1 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #000000;
}

h2 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #000000;
}

h3 {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #000000;
}

/* ========== SEPARATOR ========== */

hr {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #FFFFFF;
    margin: 10px 0;
}

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .window-large,
    .window-medium,
    .window-small {
        max-width: 100%;
    }

    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ========== LOADING SPINNER ========== */

.spinner {
    border: 3px solid #C0C0C0;
    border-top: 3px solid #000080;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== CONTEXT MENU ========== */

.context-menu {
    position: absolute;
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.context-menu.active {
    display: block;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 2px;
}

.context-menu li {
    padding: 4px 20px;
    cursor: pointer;
}

.context-menu li:hover {
    background: #000080;
    color: #FFFFFF;
}

.context-menu hr {
    margin: 2px 0;
}
